All of lore.kernel.org
 help / color / mirror / Atom feed
* [1.52][PATCH 0/4] Review request
@ 2021-11-16 16:26 Anuj Mittal
  2021-11-16 16:26 ` [1.52][PATCH 1/4] cooker: Handle parse threads disappearing to avoid hangs Anuj Mittal
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Anuj Mittal @ 2021-11-16 16:26 UTC (permalink / raw)
  To: bitbake-devel

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(-)

-- 
2.33.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [1.52][PATCH 1/4] cooker: Handle parse threads disappearing to avoid hangs
  2021-11-16 16:26 [1.52][PATCH 0/4] Review request Anuj Mittal
@ 2021-11-16 16:26 ` Anuj Mittal
  2021-11-16 16:26 ` [1.52][PATCH 2/4] cooker: Remove debug code, oops :( Anuj Mittal
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Anuj Mittal @ 2021-11-16 16:26 UTC (permalink / raw)
  To: bitbake-devel

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dc86a533d951d13643ce446533370da804782afc)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/cooker.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 06b40c13..8ae8e4ec 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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 = []
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [1.52][PATCH 2/4] cooker: Remove debug code, oops :(
  2021-11-16 16:26 [1.52][PATCH 0/4] Review request Anuj Mittal
  2021-11-16 16:26 ` [1.52][PATCH 1/4] cooker: Handle parse threads disappearing to avoid hangs Anuj Mittal
@ 2021-11-16 16:26 ` Anuj Mittal
  2021-11-16 16:26 ` [1.52][PATCH 3/4] cooker: Handle parsing results queue race Anuj Mittal
  2021-11-16 16:27 ` [1.52][PATCH 4/4] cooker: Fix task-depends.dot for multiconfig targets Anuj Mittal
  3 siblings, 0 replies; 5+ messages in thread
From: Anuj Mittal @ 2021-11-16 16:26 UTC (permalink / raw)
  To: bitbake-devel

From: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 19291665fa8b6cc331290f2542af3e8e653203f1)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/cooker.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 8ae8e4ec..9be6603f 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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()
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [1.52][PATCH 3/4] cooker: Handle parsing results queue race
  2021-11-16 16:26 [1.52][PATCH 0/4] Review request Anuj Mittal
  2021-11-16 16:26 ` [1.52][PATCH 1/4] cooker: Handle parse threads disappearing to avoid hangs Anuj Mittal
  2021-11-16 16:26 ` [1.52][PATCH 2/4] cooker: Remove debug code, oops :( Anuj Mittal
@ 2021-11-16 16:26 ` Anuj Mittal
  2021-11-16 16:27 ` [1.52][PATCH 4/4] cooker: Fix task-depends.dot for multiconfig targets Anuj Mittal
  3 siblings, 0 replies; 5+ messages in thread
From: Anuj Mittal @ 2021-11-16 16:26 UTC (permalink / raw)
  To: bitbake-devel

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 8e7f2b6500e26610f52d128b48ca0a09bf6fb2cb)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/cooker.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 9be6603f..c032762f 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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)
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [1.52][PATCH 4/4] cooker: Fix task-depends.dot for multiconfig targets
  2021-11-16 16:26 [1.52][PATCH 0/4] Review request Anuj Mittal
                   ` (2 preceding siblings ...)
  2021-11-16 16:26 ` [1.52][PATCH 3/4] cooker: Handle parsing results queue race Anuj Mittal
@ 2021-11-16 16:27 ` Anuj Mittal
  3 siblings, 0 replies; 5+ messages in thread
From: Anuj Mittal @ 2021-11-16 16:27 UTC (permalink / raw)
  To: bitbake-devel

From: Richard Purdie <richard.purdie@linuxfoundation.org>

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]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 1d5ca721040c5e39aefa11219f62710de6587701)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 lib/bb/cooker.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index c032762f..3688aa08 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -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 = []
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-16 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 16:26 [1.52][PATCH 0/4] Review request Anuj Mittal
2021-11-16 16:26 ` [1.52][PATCH 1/4] cooker: Handle parse threads disappearing to avoid hangs Anuj Mittal
2021-11-16 16:26 ` [1.52][PATCH 2/4] cooker: Remove debug code, oops :( Anuj Mittal
2021-11-16 16:26 ` [1.52][PATCH 3/4] cooker: Handle parsing results queue race Anuj Mittal
2021-11-16 16:27 ` [1.52][PATCH 4/4] cooker: Fix task-depends.dot for multiconfig targets Anuj Mittal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.