diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-30 21:39:36 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-02 07:46:40 +0100 |
commit | 3bdabde2df2cdfdf5a2fa10221abd5866cf25582 (patch) | |
tree | b074cbcea3012a927b9599c78474fae95eb404d5 /bitbake/lib/bb/command.py | |
parent | 229f88f5b5bd99fd9330b1880b331709cc7075f0 (diff) | |
download | poky-3bdabde2df2cdfdf5a2fa10221abd5866cf25582.tar.gz |
bitbake: 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.
(Bitbake rev: 0fc821a22f2b49cbd336d9658d92942c0d733be1)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/command.py')
-rw-r--r-- | bitbake/lib/bb/command.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index a355f56c60..b494f84a0a 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -65,7 +65,7 @@ class Command: | |||
65 | command = commandline.pop(0) | 65 | command = commandline.pop(0) |
66 | 66 | ||
67 | # Ensure cooker is ready for commands | 67 | # Ensure cooker is ready for commands |
68 | if command != "updateConfig" and command != "setFeatures": | 68 | if command not in ["updateConfig", "setFeatures", "ping"]: |
69 | try: | 69 | try: |
70 | self.cooker.init_configdata() | 70 | self.cooker.init_configdata() |
71 | if not self.remotedatastores: | 71 | if not self.remotedatastores: |
@@ -85,7 +85,8 @@ class Command: | |||
85 | if not hasattr(command_method, 'readonly') or not getattr(command_method, 'readonly'): | 85 | if not hasattr(command_method, 'readonly') or not getattr(command_method, 'readonly'): |
86 | return None, "Not able to execute not readonly commands in readonly mode" | 86 | return None, "Not able to execute not readonly commands in readonly mode" |
87 | try: | 87 | try: |
88 | self.cooker.process_inotify_updates_apply() | 88 | if command != "ping": |
89 | self.cooker.process_inotify_updates_apply() | ||
89 | if getattr(command_method, 'needconfig', True): | 90 | if getattr(command_method, 'needconfig', True): |
90 | self.cooker.updateCacheSync() | 91 | self.cooker.updateCacheSync() |
91 | result = command_method(self, commandline) | 92 | result = command_method(self, commandline) |
@@ -169,6 +170,8 @@ class CommandsSync: | |||
169 | Allow a UI to check the server is still alive | 170 | Allow a UI to check the server is still alive |
170 | """ | 171 | """ |
171 | return "Still alive!" | 172 | return "Still alive!" |
173 | ping.needconfig = False | ||
174 | ping.readonly = True | ||
172 | 175 | ||
173 | def stateShutdown(self, command, params): | 176 | def stateShutdown(self, command, params): |
174 | """ | 177 | """ |