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:44 +0000 |
commit | 72072db00465595293eda7b9b5446fcabef6552a (patch) | |
tree | cb28487dd315223508651dbbdc8eea0d8aa687a3 /bitbake/lib/bb/cooker.py | |
parent | 4a94cf21c5538232a4ca32cd249794933e31818b (diff) | |
download | poky-72072db00465595293eda7b9b5446fcabef6552a.tar.gz |
bitbake: 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.
(Bitbake rev: f45a94e6720dacf7f51ac147c115a6f608769093)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 709e69493d..f28951cce5 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -2230,6 +2230,14 @@ class CookerParser(object): | |||
2230 | else: | 2230 | else: |
2231 | bb.error("Parsing halted due to errors, see error messages above") | 2231 | bb.error("Parsing halted due to errors, see error messages above") |
2232 | 2232 | ||
2233 | # Cleanup the queue before call process.join(), otherwise there might be | ||
2234 | # deadlocks. | ||
2235 | while True: | ||
2236 | try: | ||
2237 | self.result_queue.get(timeout=0.25) | ||
2238 | except queue.Empty: | ||
2239 | break | ||
2240 | |||
2233 | def sync_caches(): | 2241 | def sync_caches(): |
2234 | for c in self.bb_caches.values(): | 2242 | for c in self.bb_caches.values(): |
2235 | bb.cache.SiggenRecipeInfo.reset() | 2243 | bb.cache.SiggenRecipeInfo.reset() |
@@ -2240,14 +2248,6 @@ class CookerParser(object): | |||
2240 | 2248 | ||
2241 | self.parser_quit.set() | 2249 | self.parser_quit.set() |
2242 | 2250 | ||
2243 | # Cleanup the queue before call process.join(), otherwise there might be | ||
2244 | # deadlocks. | ||
2245 | while True: | ||
2246 | try: | ||
2247 | self.result_queue.get(timeout=0.25) | ||
2248 | except queue.Empty: | ||
2249 | break | ||
2250 | |||
2251 | for process in self.processes: | 2251 | for process in self.processes: |
2252 | process.join(0.5) | 2252 | process.join(0.5) |
2253 | 2253 | ||