]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: bb.runqueue: fix unexpected process death logic
authorChristopher Larson <chris_larson@mentor.com>
Fri, 7 Oct 2016 04:07:41 +0000 (21:07 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 9 Oct 2016 11:33:26 +0000 (12:33 +0100)
`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.

(Bitbake rev: 267e025cad44c8bd0fb157f1f7a2e08df117ba84)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/runqueue.py

index 15716398f0bb7fdaf326a42e15d38ead58da3ea7..df7c50fe96fdefa84aaba7d6c7abbf45c0332e9b 100644 (file)
@@ -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)