diff mbox series

[15/15] server/process: Add debug to show which handlers are active

Message ID 20221229170728.880367-16-richard.purdie@linuxfoundation.org
State New
Headers show
Series Bitbake server thread enabling | expand

Commit Message

Richard Purdie Dec. 29, 2022, 5:07 p.m. UTC
Add some logging to show when handlers are added/removed to allow
a better idea of what the server code is doing from the server log
file.

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

Patch

diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 365758f85a..b69432ead2 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -112,6 +112,7 @@  class ProcessServer():
         """Register a function to be called while the server is idle"""
         assert hasattr(function, '__call__')
         self._idlefuns[function] = data
+        serverlog("Registering idle function %s" % str(function))
 
     def run(self):
 
@@ -380,10 +381,12 @@  class ProcessServer():
                 try:
                     retval = function(self, data, False)
                     if isinstance(retval, idleFinish):
+                        serverlog("Removing idle function %s at idleFinish" % str(function))
                         del self._idlefuns[function]
                         self.cooker.command.finishAsyncCommand(retval.msg)
                         nextsleep = None
                     if retval is False:
+                        serverlog("Removing idle function %s" % str(function))
                         del self._idlefuns[function]
                         nextsleep = None
                     elif retval is True: