Merge lp:~abentley/launchpad/job-db-user into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Edwin Grubbs on 2010-02-24 |
| Approved revision: | not available |
| Merged at revision: | not available |
| Proposed branch: | lp:~abentley/launchpad/job-db-user |
| Merge into: | lp:launchpad |
| Diff against target: |
151 lines (+35/-16) 2 files modified
lib/lp/services/job/runner.py (+25/-14) lib/lp/services/job/tests/test_runner.py (+10/-2) |
| To merge this branch: | bzr merge lp:~abentley/launchpad/job-db-user |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Edwin Grubbs (community) | 2010-02-24 | Approve on 2010-02-24 | |
|
Review via email:
|
|||
| Aaron Bentley (abentley) wrote : | # |
| Edwin Grubbs (edwin-grubbs) wrote : | # |
>=== modified file 'lib/lp/
>--- lib/lp/
>+++ lib/lp/
>@@ -203,7 +204,7 @@
> return cls(job_
>
> @classmethod
>- def runFromSource(cls, job_source, logger):
>+ def runFromSource(cls, job_source, dbuser, logger):
> """Run all ready jobs provided by the specified source."""
> with removeSecurityP
> logger.
>@@ -364,10 +368,10 @@
> self.terminated()
>
> @classmethod
>- def runFromSource(cls, job_source, logger, error_utility=
>+ def runFromSource(cls, job_source, dbuser, logger, error_utility=
> """Run all ready jobs provided by the specified source."""
> logger.
>- runner = cls(job_source, logger, error_utility)
>+ runner = cls(job_source, dbuser, logger, error_utility)
> reactor.
> handler = getsignal(SIGCHLD)
> try:
Hi Aaron,
This looks good. Please make the runFromSource() parameter lists match
for the two classes and add info in the docstring about whether the
dbuser parameter is used or ignored. The diff
merge-conditional
-Edwin

= Summary =
Ensure Twisted job runner uses the correct database user. Currently,
update_preview_diff fails because it runs as lp_main, which is not permitted to
run on asuka.
== Proposed fix ==
Pass the database user as a parameter to the child process.
== Pre-implementation notes ==
None
== Implementation details ==
Unfortunately, Ampoule uses the JobRunnerProcess class as a ContextManager, not
the instance of JobRunnerProcess that it creates. I'll propose fixing that
in Ampoule itself, but this approach works in the meantime, and database users
are effectively global.
== Tests ==
bin/test test_runner -t timeout
== Demo and Q/A == Create a merge proposal on staging, get a LOSA to add
--twisted to the flags, push changes to the source branch, and see whether the
diff is updated.
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: services/ job/tests/ test_runner. py services/ job/runner. py
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ services/ job/runner. py
31: [F0401] Unable to import 'lazr.delegates' (No module named delegates)