Merge lp:~abentley/launchpad/twistedjob into lp:launchpad
Proposed by
Aaron Bentley
Status: | Merged |
---|---|
Approved by: | Aaron Bentley |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~abentley/launchpad/twistedjob |
Merge into: | lp:launchpad |
Prerequisite: | lp:~abentley/launchpad/twistedjob-enhancements |
Diff against target: |
228 lines (+122/-29) 3 files modified
cronscripts/update_preview_diffs.py (+11/-1) lib/lp/code/scripts/tests/test_update_preview_diffs.py (+16/-0) lib/lp/services/job/runner.py (+95/-28) |
To merge this branch: | bzr merge lp:~abentley/launchpad/twistedjob |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+15980@code.launchpad.net |
To post a comment you must log in.
= Summary =
Provide a way of running jobs through Twisted
== Proposed fix ==
Provide a TwistedJobRunner, and adjust related interfaces.
== Pre-implementation notes ==
Preimplementation was with thumper.
== Implementation details ==
Extract BaseJobRunner from JobRunner. Extract runJobHandleError from
runAll.
Implement TwistedJobRunner, derived from BaseJobRunner. Use the task support TaskConsumer to consume these tasks.
classes to implement support for running jobs via Twisted. Specifically,
Provide a PollingTaskSource that returns a lambda to call runJobHandleError.
Use the ParallelLimited
Implement runAll in terms of ParallelLimited TaskConsumer. Note that, at this TaskConsumer is
time, this does not cause parallelism, because ParallelLimited
parameterized to run 1 task at a time.
Implement JobRunner. runFromSource method, because this can be polymophic.
Adjust JobCronScript to take a runner_class, so that it can optionally use
Twisted.
Change update_ prefiew_ diffs to run under Twisted if the --twisted option is
supplied.
== Tests == preview_ diffs
bin/test -t update_
== Demo and Q/A == preview_ diffs with
Have the LOSAs change the staging cron script to run update_
--twisted. Cause a preview diff to be generated. Examine the log, and see
that it ran under Twisted.