diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-21 19:29:51 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-24 21:59:17 +0000 |
commit | f45a94e6720dacf7f51ac147c115a6f608769093 (patch) | |
tree | 16db5ef79492cd2ffaf38dcf01039bfd079b8d53 | |
parent | abeff1f80bb1c690b92d535d472dff9df7a56067 (diff) | |
download | bitbake-contrib-f45a94e6720dacf7f51ac147c115a6f608769093.tar.gz |
cooker: Fix parsing race around cache handling
When draining the result queue from the parsing processes, cache objects
can be created even if they are then immediately destroyed. The reset
in the sync code needs to happen after any objects have been created.
Change the ordering to fix this. This ordering has caused various
cache errors, particularly when interrupting parsing with Ctrl+C.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/cooker.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 709e69493..f28951cce 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -2230,6 +2230,14 @@ class CookerParser(object): else: bb.error("Parsing halted due to errors, see error messages above") + # Cleanup the queue before call process.join(), otherwise there might be + # deadlocks. + while True: + try: + self.result_queue.get(timeout=0.25) + except queue.Empty: + break + def sync_caches(): for c in self.bb_caches.values(): bb.cache.SiggenRecipeInfo.reset() @@ -2240,14 +2248,6 @@ class CookerParser(object): self.parser_quit.set() - # Cleanup the queue before call process.join(), otherwise there might be - # deadlocks. - while True: - try: - self.result_queue.get(timeout=0.25) - except queue.Empty: - break - for process in self.processes: process.join(0.5) |