summaryrefslogtreecommitdiffstats
path: root/bitbake
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:18 +0100
commitb31affa946a1131cfc2f00367f162e747f3bb8e8 (patch)
tree0660310ac6962e1eb2e31cc0c8a9e15218d4da99 /bitbake
parentf8c304e07a82921c3f6b7bc482b17cb46d004dc5 (diff)
downloadpoky-b31affa946a1131cfc2f00367f162e747f3bb8e8.tar.gz
bitbake: 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). (Bitbake rev: 1dcc4e29dee3fd0dd4d6dc2fc9ccdc5888fcfcf3) 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>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 11cc2b9546..4820d268e2 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -2056,12 +2056,11 @@ class CookerParser(object):
2056 self.total) 2056 self.total)
2057 2057
2058 bb.event.fire(event, self.cfgdata) 2058 bb.event.fire(event, self.cfgdata)
2059 for process in self.processes: 2059
2060 self.parser_quit.put(None) 2060 # Allow data left in the cancel queue to be discarded
2061 else: 2061 self.parser_quit.cancel_join_thread()
2062 self.parser_quit.cancel_join_thread() 2062 for process in self.processes:
2063 for process in self.processes: 2063 self.parser_quit.put(None)
2064 self.parser_quit.put(None)
2065 2064
2066 # Cleanup the queue before call process.join(), otherwise there might be 2065 # Cleanup the queue before call process.join(), otherwise there might be
2067 # deadlocks. 2066 # deadlocks.
@@ -2078,6 +2077,9 @@ class CookerParser(object):
2078 else: 2077 else:
2079 process.join() 2078 process.join()
2080 2079
2080 self.parser_quit.close()
2081 self.parser_quit.join_thread()
2082
2081 sync = threading.Thread(target=self.bb_cache.sync) 2083 sync = threading.Thread(target=self.bb_cache.sync)
2082 sync.start() 2084 sync.start()
2083 multiprocessing.util.Finalize(None, sync.join, exitpriority=-100) 2085 multiprocessing.util.Finalize(None, sync.join, exitpriority=-100)