summaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-06-14 12:10:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 11:15:47 +0100
commit5639faa3eef55cc476a82e810e61ca228cbdf221 (patch)
tree28f6dbc364a864db9a914ac9f6e688b436810df2 /lib/bb/cooker.py
parent18dfd144d0da6ff662308ce4f9d135dc11412133 (diff)
downloadbitbake-contrib-5639faa3eef55cc476a82e810e61ca228cbdf221.tar.gz
cooker: ensure graceful exit after exception during BuildCompleted handler
If an event handler for bb.event.BuildCompleted fails, we still need to call finishAsyncCommand() or else BitBake will just exit immediately without showing any error summary, or worse in the case of memory resident mode BitBake will hang and if you Ctrl+C to break out, the command won't be marked as finished which means that no further commands will be able to be executed until the server is manually restarted. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 6a1b649f7..479dc5a11 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1361,8 +1361,10 @@ class BBCooker:
return False
if not retval:
- bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.data)
- self.command.finishAsyncCommand(msg)
+ try:
+ bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runtaskentries), buildname, targets, failures, interrupted), self.data)
+ finally:
+ self.command.finishAsyncCommand(msg)
return False
if retval is True:
return True