diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2017-06-14 12:10:25 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-06-14 11:15:47 +0100 |
commit | 5639faa3eef55cc476a82e810e61ca228cbdf221 (patch) | |
tree | 28f6dbc364a864db9a914ac9f6e688b436810df2 /lib/bb/cooker.py | |
parent | 18dfd144d0da6ff662308ce4f9d135dc11412133 (diff) | |
download | bitbake-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.py | 6 |
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 |