Skip to contentSkip to conversation

[1.52][PATCH 0/4] Review request

DISCUSSION Anuj Mittal 1 participant 5 messages Nov 16, 2021

lore
Share & tools
lore
#1 lore raw

[1.52][PATCH 2/4] cooker: Remove debug code, oops :(

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

(cherry picked from commit 19291665fa8b6cc331290f2542af3e8e653203f1)
---
 lib/bb/cooker.py | 1 -
 1 file changed, 1 deletion(-)
lib/bb/cooker.py +0 -1
index 8ae8e4ec..9be6603f 100644
@@ -2040,7 +2040,6 @@ class Parser(multiprocessing.Process):
                 result = pending.pop()
             else:
                 try:
-                    time.sleep(0.25)
                     job = self.jobs.pop()
                 except IndexError:
                     self.results.close()
Signature · 1 line
2.33.1
#0 lore raw

Please review these changes for 1.52. No problems seen while testing on autobuilder.

Thanks,

Anuj

The following changes since commit 693eec8edf8d3b2b01c53be6776213cccd797485:

runqueue: Fix runall option handling (2021-11-12 14:16:48 +0800)

are available in the Git repository at:

git://push.openembedded.org/bitbake-contrib stable/1.52-next

Richard Purdie (4):
cooker: Handle parse threads disappearing to avoid hangs
cooker: Remove debug code, oops :(
cooker: Handle parsing results queue race
cooker: Fix task-depends.dot for multiconfig targets

 lib/bb/cooker.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
Signature · 1 line
2.33.1
#2 lore raw

[1.52][PATCH 1/4] cooker: Handle parse threads disappearing to avoid hangs

From: Richard Purdie <[email protected]>

If one of the parse threads disappears during parsing for some reason, bitbake currently hangs. Avoid this (and zombie threads hanging around) by joining() threads which have exited.

(cherry picked from commit dc86a533d951d13643ce446533370da804782afc)
---
 lib/bb/cooker.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
lib/bb/cooker.py +10 -1
index 06b40c13..8ae8e4ec 100644
@@ -2040,6 +2040,7 @@ class Parser(multiprocessing.Process):
                 result = pending.pop()
             else:
                 try:
+                    time.sleep(0.25)
                     job = self.jobs.pop()
                 except IndexError:
                     self.results.close()
@@ -2218,7 +2219,7 @@ class CookerParser(object):
             yield not cached, mc, infos
 
     def parse_generator(self):
-        while True:
+        while self.processes:
             if self.parsed >= self.toparse:
                 break
 
@@ -2232,6 +2233,14 @@ class CookerParser(object):
                     raise value
                 else:
                     yield result
+            for process in self.processes.copy():
+                if not process.is_alive():
+                    process.join()
+                    self.processes.remove(process)
+
+        if not (self.parsed >= self.toparse):
+            raise bb.parse.ParseError("Not all recipes parsed, parser thread killed/died? Exiting.", None)
+
 
     def parse_next(self):
         result = []
Signature · 1 line
2.33.1
#3 lore raw

[1.52][PATCH 3/4] cooker: Handle parsing results queue race

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The previous fix introduced a race where the queue might not be empty but all the parser processes have exited. Handle this correctly to avoid occasional errors.

(cherry picked from commit 8e7f2b6500e26610f52d128b48ca0a09bf6fb2cb)
---
 lib/bb/cooker.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
lib/bb/cooker.py +9 -5
index 9be6603f..c032762f 100644
@@ -2218,24 +2218,28 @@ class CookerParser(object):
             yield not cached, mc, infos
 
     def parse_generator(self):
-        while self.processes:
+        empty = False
+        while self.processes or not empty:
+            for process in self.processes.copy():
+                if not process.is_alive():
+                    process.join()
+                    self.processes.remove(process)
+
             if self.parsed >= self.toparse:
                 break
 
             try:
                 result = self.result_queue.get(timeout=0.25)
             except queue.Empty:
+                empty = True
                 pass
             else:
+                empty = False
                 value = result[1]
                 if isinstance(value, BaseException):
                     raise value
                 else:
                     yield result
-            for process in self.processes.copy():
-                if not process.is_alive():
-                    process.join()
-                    self.processes.remove(process)
 
         if not (self.parsed >= self.toparse):
             raise bb.parse.ParseError("Not all recipes parsed, parser thread killed/died? Exiting.", None)
Signature · 1 line
2.33.1
#4 lore raw

[1.52][PATCH 4/4] cooker: Fix task-depends.dot for multiconfig targets

In reply to Anuj Mittal

From: Richard Purdie <[email protected]>

The right hand side of dependencies in the task dependency file generated by bitbake -g was missing multiconfig prefixes, corrupting the data. Fix this.

[YOCTO #14621]

(cherry picked from commit 1d5ca721040c5e39aefa11219f62710de6587701)
---
 lib/bb/cooker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/bb/cooker.py +3 -1
index c032762f..3688aa08 100644
@@ -814,7 +814,9 @@ class BBCooker:
             for dep in rq.rqdata.runtaskentries[tid].depends:
                 (depmc, depfn, _, deptaskfn) = bb.runqueue.split_tid_mcfn(dep)
                 deppn = self.recipecaches[depmc].pkg_fn[deptaskfn]
-                depend_tree["tdepends"][dotname].append("%s.%s" % (deppn, bb.runqueue.taskname_from_tid(dep)))
+                if depmc:
+                    depmc = "mc:" + depmc + ":"
+                depend_tree["tdepends"][dotname].append("%s%s.%s" % (depmc, deppn, bb.runqueue.taskname_from_tid(dep)))
             if taskfn not in seen_fns:
                 seen_fns.append(taskfn)
                 packages = []
Signature · 1 line
2.33.1