All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] command: Avoid time intensive distractions for ping
@ 2023-08-30 21:33 Richard Purdie
  2023-08-31  8:51 ` [bitbake-devel] " Mikko Rapeli
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2023-08-30 21:33 UTC (permalink / raw)
  To: bitbake-devel

We noticed some users were seeing very slow ping response times which
caused 'server timeout' issues. There were some function calls in runCommand
which could be slow such as the inotify callback processing.

Mark up the ping command such that it doesn't need configuration information,
it is allowed on a readonly server and specifically skip the inofity processing
too since ping would never need that.

This will hopefully resolve various ping timeout issues that were being reported.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/command.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/command.py b/lib/bb/command.py
index a355f56c60..b494f84a0a 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -65,7 +65,7 @@ class Command:
         command = commandline.pop(0)
 
         # Ensure cooker is ready for commands
-        if command != "updateConfig" and command != "setFeatures":
+        if command not in ["updateConfig", "setFeatures", "ping"]:
             try:
                 self.cooker.init_configdata()
                 if not self.remotedatastores:
@@ -85,7 +85,8 @@ class Command:
                 if not hasattr(command_method, 'readonly') or not getattr(command_method, 'readonly'):
                     return None, "Not able to execute not readonly commands in readonly mode"
             try:
-                self.cooker.process_inotify_updates_apply()
+                if command != "ping":
+                    self.cooker.process_inotify_updates_apply()
                 if getattr(command_method, 'needconfig', True):
                     self.cooker.updateCacheSync()
                 result = command_method(self, commandline)
@@ -169,6 +170,8 @@ class CommandsSync:
         Allow a UI to check the server is still alive
         """
         return "Still alive!"
+    ping.needconfig = False
+    ping.readonly = True
 
     def stateShutdown(self, command, params):
         """
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-04  7:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30 21:33 [PATCH] command: Avoid time intensive distractions for ping Richard Purdie
2023-08-31  8:51 ` [bitbake-devel] " Mikko Rapeli
2023-08-31  8:56   ` Richard Purdie
2023-08-31 11:30     ` Mikko Rapeli
2023-08-31 12:01       ` Richard Purdie
2023-09-04  6:47         ` Mikko Rapeli
2023-09-04  7:07           ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.