diff options
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r-- | bitbake/lib/bb/server/process.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index 91eb6e0ad9..eba28ad983 100644 --- a/bitbake/lib/bb/server/process.py +++ b/bitbake/lib/bb/server/process.py | |||
@@ -106,6 +106,7 @@ class ProcessServer(): | |||
106 | """Register a function to be called while the server is idle""" | 106 | """Register a function to be called while the server is idle""" |
107 | assert hasattr(function, '__call__') | 107 | assert hasattr(function, '__call__') |
108 | self._idlefuns[function] = data | 108 | self._idlefuns[function] = data |
109 | serverlog("Registering idle function %s" % str(function)) | ||
109 | 110 | ||
110 | def run(self): | 111 | def run(self): |
111 | 112 | ||
@@ -361,6 +362,7 @@ class ProcessServer(): | |||
361 | try: | 362 | try: |
362 | retval = function(self, data, False) | 363 | retval = function(self, data, False) |
363 | if retval is False: | 364 | if retval is False: |
365 | serverlog("Removing idle function %s" % str(function)) | ||
364 | del self._idlefuns[function] | 366 | del self._idlefuns[function] |
365 | nextsleep = None | 367 | nextsleep = None |
366 | elif retval is True: | 368 | elif retval is True: |
@@ -378,6 +380,7 @@ class ProcessServer(): | |||
378 | if not isinstance(exc, bb.BBHandledException): | 380 | if not isinstance(exc, bb.BBHandledException): |
379 | logger.exception('Running idle function') | 381 | logger.exception('Running idle function') |
380 | del self._idlefuns[function] | 382 | del self._idlefuns[function] |
383 | serverlog("Exception %s broke the idle_thread, exiting" % traceback.format_exc()) | ||
381 | self.quit = True | 384 | self.quit = True |
382 | 385 | ||
383 | # Create new heartbeat event? | 386 | # Create new heartbeat event? |
@@ -395,6 +398,7 @@ class ProcessServer(): | |||
395 | except Exception as exc: | 398 | except Exception as exc: |
396 | if not isinstance(exc, bb.BBHandledException): | 399 | if not isinstance(exc, bb.BBHandledException): |
397 | logger.exception('Running heartbeat function') | 400 | logger.exception('Running heartbeat function') |
401 | serverlog("Exception %s broke in idle_commands, exiting" % traceback.format_exc()) | ||
398 | self.quit = True | 402 | self.quit = True |
399 | if nextsleep and bb.event._heartbeat_enabled and now + nextsleep > self.next_heartbeat: | 403 | if nextsleep and bb.event._heartbeat_enabled and now + nextsleep > self.next_heartbeat: |
400 | # Shorten timeout so that we we wake up in time for | 404 | # Shorten timeout so that we we wake up in time for |