Skip to contentSkip to conversation

cooker: Start sync thread a little earlier

PATCH New Richard Purdie 1 participant 1 message Dec 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cooker: Start sync thread a little earlier

From: Joshua Watt <[email protected]>

Starts the sync thread slightly earlier to give it some extra time to dump out the caches while the main process tears down the parsing processes

---
 lib/bb/cooker.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
lib/bb/cooker.py +7 -6
index 7f232f2b36..728ef09675 100644
@@ -2222,6 +2222,13 @@ class CookerParser(object):
         else:
             bb.error("Parsing halted due to errors, see error messages above")
 
+        def sync_caches():
+            for c in self.bb_caches.values():
+                c.sync()
+
+        self.syncthread = threading.Thread(target=sync_caches, name="SyncThread")
+        self.syncthread.start()
+
         self.parser_quit.set()
 
         # Cleanup the queue before call process.join(), otherwise there might be
@@ -2252,13 +2259,7 @@ class CookerParser(object):
             if hasattr(process, "close"):
                 process.close()
 
-        def sync_caches():
-            for c in self.bb_caches.values():
-                c.sync()
 
-        sync = threading.Thread(target=sync_caches, name="SyncThread")
-        self.syncthread = sync
-        sync.start()
         bb.codeparser.parser_cache_savemerge()
         bb.fetch.fetcher_parse_done()
         if self.cooker.configuration.profile:
Signature · 1 line
2.34.1