diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-09 10:01:19 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-03-10 11:09:58 -0700 |
commit | b28f00718ca9e4fd9f7c04c1cbfcdb9e4a411efd (patch) | |
tree | 889c3e8c167619c792fcad0d273454991069225a | |
parent | bb335f96baf5f4cdaa42fd8856ab736d1f7b8d80 (diff) | |
download | ast2050-yocto-poky-b28f00718ca9e4fd9f7c04c1cbfcdb9e4a411efd.zip ast2050-yocto-poky-b28f00718ca9e4fd9f7c04c1cbfcdb9e4a411efd.tar.gz |
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>
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 967e944..7d3e91a 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py @@ -900,8 +900,11 @@ class RunQueue: if not worker: return logger.debug(1, "Teardown for bitbake-worker") - worker.stdin.write("<quit></quit>") - worker.stdin.flush() + try: + worker.stdin.write("<quit></quit>") + worker.stdin.flush() + except IOError: + pass while worker.returncode is None: workerpipe.read() worker.poll() @@ -1275,11 +1278,15 @@ class RunQueueExecute: def finish_now(self): - self.rq.worker.stdin.write("<finishnow></finishnow>") - self.rq.worker.stdin.flush() - if self.rq.fakeworker: - self.rq.fakeworker.stdin.write("<finishnow></finishnow>") - self.rq.fakeworker.stdin.flush() + for worker in [self.rq.worker, self.rq.fakeworker]: + if not worker: + continue + try: + worker.stdin.write("<finishnow></finishnow>") + worker.stdin.flush() + except IOError: + # worker must have died? + pass if len(self.failed_fnids) != 0: self.rq.state = runQueueFailed |