diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-30 21:39:36 +0100 |
---|---|---|
committer | Martin Jansa <martin.jansa@gmail.com> | 2023-12-21 14:03:53 +0100 |
commit | eed256cad5fb8cf572b8be2abfdca7b09253cc09 (patch) | |
tree | 7d147a0a6d0d6f5b900d07696b59e485d7e4f0bf | |
parent | c41ebf9c102c6a697fe38dfac37a317ef283242b (diff) | |
download | bitbake-contrib-eed256cad5fb8cf572b8be2abfdca7b09253cc09.tar.gz |
command: Avoid time intensive distractions for ping
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>
-rw-r--r-- | lib/bb/command.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py index 9e2cdc5c7..7f3fb1c94 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): """ |