Merge lp:~thomir-deactivatedaccount/adt-cloud-worker/trunk-trap-kill into lp:adt-cloud-worker

Proposed by Thomi Richards
Status: Merged
Approved by: Thomi Richards
Approved revision: 37
Merged at revision: 36
Proposed branch: lp:~thomir-deactivatedaccount/adt-cloud-worker/trunk-trap-kill
Merge into: lp:adt-cloud-worker
Diff against target: 20 lines (+2/-1)
1 file modified
adt_cloud_worker/__init__.py (+2/-1)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/adt-cloud-worker/trunk-trap-kill
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Evan (community) Approve
Para Siva (community) Approve
Joe Talbott (community) Approve
Review via email: mp+256669@code.launchpad.net

Commit message

Catch KeyboardInterrupt so we don't put malformed payloads on the message queue.

Description of the change

Catch KeyboardInterrupt so we don't put malformed payloads on the message queue.

To post a comment you must log in.
Revision history for this message
Joe Talbott (joetalbott) wrote :

This looks okay assuming we're not doing any threading that might cause a different thread to catch the SIGINT and raise the exception in a different thread.

review: Approve
Revision history for this message
Evan (ev) :
Revision history for this message
Para Siva (psivaa) wrote :

+1 bar just an inline comment.

review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Evan (ev) :
review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'adt_cloud_worker/__init__.py'
2--- adt_cloud_worker/__init__.py 2015-04-15 19:15:32 +0000
3+++ adt_cloud_worker/__init__.py 2015-04-17 14:51:27 +0000
4@@ -89,6 +89,7 @@
5 for later checking.
6 """
7 body['worker'] = self.worker_name
8+ body['exit_code'] = 100
9 extra = logging_extra.copy()
10 extra.update(body)
11 logger.info('Received message request: %s', body, extra=extra)
12@@ -123,7 +124,7 @@
13 # by the adt-result-checker.
14 container_name = 'adt-{}'.format(body['request_id'])
15 upload_tarball_to_swift_container(tarball_path, container_name)
16- except Exception as e:
17+ except BaseException as e:
18 # Unexpected failures are tagged with special exit_code 100 and
19 # carry the worker_traceback in the message payload. This will
20 # help debugging of deadletter-ed messages.

Subscribers

People subscribed via source and target branches

to all changes: