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-09 18:58:49 -0700 |
commit | 1b1672e1ceff17fc4ff8eb7aa46f59fce3593873 (patch) | |
tree | 5a7c7ff0bd0a488c15d7df8dcfa963ca79c91c5a /lib/bb/runqueue.py | |
parent | ee28ddadaa7ef91e4d4b7d22fc267382aaad6d01 (diff) | |
download | openembedded-core-contrib-1b1672e1ceff17fc4ff8eb7aa46f59fce3593873.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/runqueue.py')
-rw-r--r-- | lib/bb/runqueue.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py index 967e944963..7d3e91a743 100644 --- a/lib/bb/runqueue.py +++ b/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 |