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
=== modified file 'adt_cloud_worker/__init__.py'
--- adt_cloud_worker/__init__.py 2015-04-15 19:15:32 +0000
+++ adt_cloud_worker/__init__.py 2015-04-17 14:51:27 +0000
@@ -89,6 +89,7 @@
89 for later checking.89 for later checking.
90 """90 """
91 body['worker'] = self.worker_name91 body['worker'] = self.worker_name
92 body['exit_code'] = 100
92 extra = logging_extra.copy()93 extra = logging_extra.copy()
93 extra.update(body)94 extra.update(body)
94 logger.info('Received message request: %s', body, extra=extra)95 logger.info('Received message request: %s', body, extra=extra)
@@ -123,7 +124,7 @@
123 # by the adt-result-checker.124 # by the adt-result-checker.
124 container_name = 'adt-{}'.format(body['request_id'])125 container_name = 'adt-{}'.format(body['request_id'])
125 upload_tarball_to_swift_container(tarball_path, container_name)126 upload_tarball_to_swift_container(tarball_path, container_name)
126 except Exception as e:127 except BaseException as e:
127 # Unexpected failures are tagged with special exit_code 100 and128 # Unexpected failures are tagged with special exit_code 100 and
128 # carry the worker_traceback in the message payload. This will129 # carry the worker_traceback in the message payload. This will
129 # help debugging of deadletter-ed messages.130 # help debugging of deadletter-ed messages.

Subscribers

People subscribed via source and target branches

to all changes: