[oe-commits] [bitbake] 01/03: bb.runqueue: fix unexpected process death logic

git at git.openembedded.org git at git.openembedded.org
Fri Oct 7 15:45:40 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 267e025cad44c8bd0fb157f1f7a2e08df117ba84
Author: Christopher Larson <chris_larson at mentor.com>
AuthorDate: Thu Oct 6 21:07:41 2016 -0700

    bb.runqueue: fix unexpected process death logic
    
    `if w in self.rq.worker` when w *is* self.rq.worker doesn't make a great deal
    of sense, and results in this error:
    
          File ".../poky/bitbake/lib/bb/runqueue.py", line 2372, in runQueuePipe.read():
                                 name = None
            >                    if w in self.rq.worker:
                                     name = "Worker"
        TypeError: unhashable type: 'dict'
    
    Most likely this was meant to be 'is' rather than 'in', but rather than
    checking after the fact, just include the name in the iteration, instead.
    
    While we're here, also clean up and fix the broken error message.
    
    Signed-off-by: Christopher Larson <chris_larson at mentor.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/runqueue.py | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 1571639..df7c50f 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2365,16 +2365,11 @@ class runQueuePipe():
         self.rqexec = rqexec
 
     def read(self):
-        for w in [self.rq.worker, self.rq.fakeworker]:
-            for mc in w:
-                w[mc].process.poll()
-                if w[mc].process.returncode is not None and not self.rq.teardown:
-                    name = None
-                    if w in self.rq.worker:
-                        name = "Worker"
-                    elif w in self.rq.fakeworker:
-                        name = "Fakeroot"
-                    bb.error("%s process (%s) exited unexpectedly (%s), shutting down..." % (name, w.pid, str(w.returncode)))
+        for workers, name in [(self.rq.worker, "Worker"), (self.rq.fakeworker, "Fakeroot")]:
+            for worker in workers.values():
+                worker.process.poll()
+                if worker.process.returncode is not None and not self.rq.teardown:
+                    bb.error("%s process (%s) exited unexpectedly (%s), shutting down..." % (name, worker.process.pid, str(worker.process.returncode)))
                     self.rq.finish_runqueue(True)
 
         start = len(self.queue)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list