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 /bitbake/lib/bb | |
parent | bb335f96baf5f4cdaa42fd8856ab736d1f7b8d80 (diff) | |
download | 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>
Diffstat (limited to 'bitbake/lib/bb')
-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 967e944963..7d3e91a743 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -900,8 +900,11 @@ class RunQueue: | |||
900 | if not worker: | 900 | if not worker: |
901 | return | 901 | return |
902 | logger.debug(1, "Teardown for bitbake-worker") | 902 | logger.debug(1, "Teardown for bitbake-worker") |
903 | worker.stdin.write("<quit></quit>") | 903 | try: |
904 | worker.stdin.flush() | 904 | worker.stdin.write("<quit></quit>") |
905 | worker.stdin.flush() | ||
906 | except IOError: | ||
907 | pass | ||
905 | while worker.returncode is None: | 908 | while worker.returncode is None: |
906 | workerpipe.read() | 909 | workerpipe.read() |
907 | worker.poll() | 910 | worker.poll() |
@@ -1275,11 +1278,15 @@ class RunQueueExecute: | |||
1275 | 1278 | ||
1276 | def finish_now(self): | 1279 | def finish_now(self): |
1277 | 1280 | ||
1278 | self.rq.worker.stdin.write("<finishnow></finishnow>") | 1281 | for worker in [self.rq.worker, self.rq.fakeworker]: |
1279 | self.rq.worker.stdin.flush() | 1282 | if not worker: |
1280 | if self.rq.fakeworker: | 1283 | continue |
1281 | self.rq.fakeworker.stdin.write("<finishnow></finishnow>") | 1284 | try: |
1282 | self.rq.fakeworker.stdin.flush() | 1285 | worker.stdin.write("<finishnow></finishnow>") |
1286 | worker.stdin.flush() | ||
1287 | except IOError: | ||
1288 | # worker must have died? | ||
1289 | pass | ||
1283 | 1290 | ||
1284 | if len(self.failed_fnids) != 0: | 1291 | if len(self.failed_fnids) != 0: |
1285 | self.rq.state = runQueueFailed | 1292 | self.rq.state = runQueueFailed |