Merge lp:~doanac/ubuntu-ci-services-itself/runworker-cancellable into lp:ubuntu-ci-services-itself
Status: | Merged |
---|---|
Approved by: | Andy Doan |
Approved revision: | 343 |
Merged at revision: | 357 |
Proposed branch: | lp:~doanac/ubuntu-ci-services-itself/runworker-cancellable |
Merge into: | lp:ubuntu-ci-services-itself |
Prerequisite: | lp:~doanac/ubuntu-ci-services-itself/runworker-basic |
Diff against target: |
177 lines (+109/-1) 2 files modified
ci-utils/ci_utils/amqp_worker.py (+62/-1) ci-utils/ci_utils/tests/test_amqp_worker.py (+47/-0) |
To merge this branch: | bzr merge lp:~doanac/ubuntu-ci-services-itself/runworker-cancellable |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+210077@code.launchpad.net |
Commit message
run-worker: add cancelling logic
This provides "advisory" cancelling logic to the run-worker base. If
subclasses choose, they may periodically check the state of
params.
to see if they should clean up and exit
Description of the change
Part 2 of my 3 part series.
Adds logic for determining if a worker's corresponding jenkins job has been cancelled. The mechanism currently used is purely advisory for now (ie - the worker has the option to try and honor this or not).
We could enhance this to allow workers to specify they want a more forceful cancel option (ie sigterm ourselves or something). However, I think this is probably a better first step and keeps things easier to review.
I'm not a huge fan of tests that use time.sleep, but I really wanted to test this really worked without overly mocking it.
PASSED: Continuous integration, rev:343 s-jenkins. ubuntu- ci:8080/ job/uci- engine- ci/350/
http://
Executed test runs:
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/uci- engine- ci/350/ rebuild
http://