[3/3] server/process: Move threads left debug to after cooker shutdown

Message ID 20220325092912.1350321-3-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 1463fc0448d1a6a7265806a4a8b165b610dfb43f
Headers show
Series [1/3] cooker/siggen: Support exit calls and use for hashserv client | expand

Commit Message

Richard Purdie March 25, 2022, 9:29 a.m. UTC
This debug is useful but the cooker shutdown or post_serve() may have cleanup
left so run after those.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/server/process.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 1636616660..efc3f04b4c 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -243,9 +243,6 @@  class ProcessServer():
 
             ready = self.idle_commands(.1, fds)
 
-        if len(threading.enumerate()) != 1:
-            serverlog("More than one thread left?: " + str(threading.enumerate()))
-
         serverlog("Exiting")
         # Remove the socket file so we don't get any more connections to avoid races
         try:
@@ -263,6 +260,9 @@  class ProcessServer():
 
         self.cooker.post_serve()
 
+        if len(threading.enumerate()) != 1:
+            serverlog("More than one thread left?: " + str(threading.enumerate()))
+
         # Flush logs before we release the lock
         sys.stdout.flush()
         sys.stderr.flush()