1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-04 02:00:04 +00:00

bitbake: runqueue.py: Gracefully handle a missing worker process

If the worker has already gone missing (e.g. SIGTERM), we should
gracefully handle the write failures at exit time rather than throwing
ugly tracebacks.

(Bitbake rev: 1b1672e1ceff17fc4ff8eb7aa46f59fce3593873)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2014-03-09 10:01:19 -07:00
parent bb335f96ba
commit b28f00718c
+14 -7
View File
@@ -900,8 +900,11 @@ class RunQueue:
if not worker: if not worker:
return return
logger.debug(1, "Teardown for bitbake-worker") logger.debug(1, "Teardown for bitbake-worker")
worker.stdin.write("<quit></quit>") try:
worker.stdin.flush() worker.stdin.write("<quit></quit>")
worker.stdin.flush()
except IOError:
pass
while worker.returncode is None: while worker.returncode is None:
workerpipe.read() workerpipe.read()
worker.poll() worker.poll()
@@ -1275,11 +1278,15 @@ class RunQueueExecute:
def finish_now(self): def finish_now(self):
self.rq.worker.stdin.write("<finishnow></finishnow>") for worker in [self.rq.worker, self.rq.fakeworker]:
self.rq.worker.stdin.flush() if not worker:
if self.rq.fakeworker: continue
self.rq.fakeworker.stdin.write("<finishnow></finishnow>") try:
self.rq.fakeworker.stdin.flush() worker.stdin.write("<finishnow></finishnow>")
worker.stdin.flush()
except IOError:
# worker must have died?
pass
if len(self.failed_fnids) != 0: if len(self.failed_fnids) != 0:
self.rq.state = runQueueFailed self.rq.state = runQueueFailed