aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-15 12:00:30 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-06-19 17:06:14 +0100
commit1dcc4e29dee3fd0dd4d6dc2fc9ccdc5888fcfcf3 (patch)
tree90b1c22c1ac07ae93d772e8cf0fbe398b4cca854
parent078f3164dcb1de7a141bec3a8fd52631d0362631 (diff)
downloadbitbake-1dcc4e29dee3fd0dd4d6dc2fc9ccdc5888fcfcf3.tar.gz
cooker: Ensure parse_quit thread is closed down
Each run through the parser would leak a thread from the queue created to shut the parser down. Close this down correctly and clean up the code flow slightly whilst in the area, making sure this thread does shut down correctly (we don't care if it loses data). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 11cc2b954..4820d268e 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -2056,12 +2056,11 @@ class CookerParser(object):
self.total)
bb.event.fire(event, self.cfgdata)
- for process in self.processes:
- self.parser_quit.put(None)
- else:
- self.parser_quit.cancel_join_thread()
- for process in self.processes:
- self.parser_quit.put(None)
+
+ # Allow data left in the cancel queue to be discarded
+ self.parser_quit.cancel_join_thread()
+ for process in self.processes:
+ self.parser_quit.put(None)
# Cleanup the queue before call process.join(), otherwise there might be
# deadlocks.
@@ -2078,6 +2077,9 @@ class CookerParser(object):
else:
process.join()
+ self.parser_quit.close()
+ self.parser_quit.join_thread()
+
sync = threading.Thread(target=self.bb_cache.sync)
sync.start()
multiprocessing.util.Finalize(None, sync.join, exitpriority=-100)