diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-20 14:20:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-29 00:07:06 +0000 |
commit | 907e91796ed4156cafcbd3ee60edaa9544f0abe3 (patch) | |
tree | 29c6a113f4b38ce6426ea41d0a035df45e206792 /bitbake/lib/bb/runqueue.py | |
parent | 6549f58cd6e22b4c345212237e81e68e12dfcb61 (diff) | |
download | poky-907e91796ed4156cafcbd3ee60edaa9544f0abe3.tar.gz |
bitbake: event: builtins fix for 'd' deletion
I've been seeing event handlers where 'd' seems to disappear half way through
event handler execution. This is problematic when multiple threads are active
since this code assumes single threading.
The easiest fix is to change the handler function calls to contain d as a
parameter as we do elsewhere for other functions. This will break any non-text
handlers but I was only able to spot one of those in runqueue. It will also
break handlers than call functions that assume 'd' is in the global namespace
but those failures should be obvious and we can fix those to pass d around.
This solution avoids manipulating builtins which was always a horrible thing
to do anyway and solves the issue without needing locking, thankfully.
(Bitbake rev: 1e12f0a4b592dacd006d370ec29cd71d2a44312e)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index b9dd830b31..ce711b6252 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1511,7 +1511,7 @@ class RunQueue: | |||
1511 | 1511 | ||
1512 | if not self.dm_event_handler_registered: | 1512 | if not self.dm_event_handler_registered: |
1513 | res = bb.event.register(self.dm_event_handler_name, | 1513 | res = bb.event.register(self.dm_event_handler_name, |
1514 | lambda x: self.dm.check(self) if self.state in [runQueueRunning, runQueueCleanUp] else False, | 1514 | lambda x, y: self.dm.check(self) if self.state in [runQueueRunning, runQueueCleanUp] else False, |
1515 | ('bb.event.HeartbeatEvent',), data=self.cfgData) | 1515 | ('bb.event.HeartbeatEvent',), data=self.cfgData) |
1516 | self.dm_event_handler_registered = True | 1516 | self.dm_event_handler_registered = True |
1517 | 1517 | ||