@@ -88,6 +88,7 @@ class ProcessServer():
self.maxuiwait = 30
self.xmlrpc = False
+ self.idle_count = 1
self.idle = None
self._idlefuns = {}
@@ -178,6 +179,13 @@ class ProcessServer():
del self.event_writer
self.lastui = time.time()
self.cooker.command.finishAsyncDisconnect()
+
+ # Wait for the idle loop to have executed (5s max)
+ count = self.idle_count
+ start = time.time()
+ while count == self.idle_count and time.time() < (start + 5):
+ continue
+
self.cooker.clientComplete()
self.haveui = False
ready = select.select(fds,[],[],0)[0]
@@ -360,6 +368,11 @@ class ProcessServer():
def idle_thread(self):
while not self.quit:
+ # Show activity
+ if self.idle_count > 100000000:
+ self.idle_count = 1
+ self.idle_count = self.idle_count + 1
+
nextsleep = 0.1
fds = []
for function, data in list(self._idlefuns.items()):
When clients are disconnecting, we need to ensure things are in sync with the idle thread. This patch is probably a little paranoid but it doesn't really hurt to ensure things are properly in sync and nothing unexpected will execute. A simple counter to show activity seems to easiest way to synchronise. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> --- lib/bb/server/process.py | 13 +++++++++++++ 1 file changed, 13 insertions(+)