Merge lp:~jelmer/launchpad/robust-process-accepted into lp:launchpad
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/launchpad/robust-process-accepted |
Merge into: | lp:launchpad |
Diff against target: |
156 lines (+68/-18) 2 files modified
lib/lp/soyuz/scripts/processaccepted.py (+13/-5) lib/lp/soyuz/tests/test_processaccepted.py (+55/-13) |
To merge this branch: | bzr merge lp:~jelmer/launchpad/robust-process-accepted |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Henning Eggers (community) | code | Approve | |
Review via email: mp+23312@code.launchpad.net |
Commit message
Log OOPSes when encountering errors in process-accepted and skip just the problematic item rather than aborting.
Description of the change
This branch should make process-accepted a bit more robust. It changes it to file an OOPS when it encounters an exception while processing an item in the queue, rather than re-raising that exception, skipping the processing of the rest of the queue and rolling back the transactions.
This should make it impossible for a single problematic package to block process-accepted, as happened about a week ago.
To post a comment you must log in.
Am 13.04.2010 13:57, schrieb Jelmer Vernooij:
> This branch should make process-accepted a bit more robust. It changes it to file an OOPS when it encounters an exception while processing an item in the queue, rather than re-raising that exception, skipping the processing of the rest of the queue and rolling back the transactions.
>
> This should make it impossible for a single problematic package to block process-accepted, as happened about a week ago.
Very good, thank you for fixing this!
> === modified file 'lib/lp/ soyuz/scripts/ processaccepted .py' soyuz/scripts/ processaccepted .py 2010-02-23 10:30:56 +0000 soyuz/scripts/ processaccepted .py 2010-04-13 11:56:59 +0000 der.tagfiles import parse_tagfile_lines interfaces. bug import IBugSet interfaces. bugtask import BugTaskStatus launchpad. interfaces. launchpad import ILaunchpadCeleb rities launchpad. webapp. errorlog import ( tility, ScriptRequest) launchpad. webapp. interfaces import NotFoundError interfaces. archive import ArchivePurpose, IArchiveSet interfaces. distribution import IDistributionSet realiseUpload( self.logger)
> --- lib/lp/
> +++ lib/lp/
> @@ -11,12 +11,16 @@
> 'ProcessAccepted',
> ]
>
> +import sys
> +
> from zope.component import getUtility
>
> from lp.archiveuploa
> from lp.bugs.
> from lp.bugs.
> from canonical.
> +from canonical.
> + ErrorReportingU
> from canonical.
> from lp.soyuz.
> from lp.registry.
> @@ -244,11 +248,15 @@
> for queue_item in queue_items:
> try:
> queue_item.
Um, I thought we use en_US as the standard language ... ;-)
Not for you to fix here, though. (realizeUpload)
> - except: explanation' , message)] properties) tility( ) raising( sys.exc_ info(), request) error(' %s (%s)' % (message,
> - self.logger.error(
> - "Failure processing queue_item %d" % (
> - queue_item.id), exc_info=True)
> - raise
> + except Exception:
> + message = "Failure processing queue_item %d" % (
> + queue_item.id)
> + properties = [('error-
> + request = ScriptRequest(
> + error_utility = ErrorReportingU
> + error_utility.
> + self.logger.
> + request.oopsid))
Please put the newline right after the opening "(", as I think that conforms more to our coding style (similar to a function call in looks).
I have never had to file an OOPS before so I trust that this is the right way to do it.
> else: queue_ids. append( queue_item. id) soyuz/tests/ test_processacc epted.py' soyuz/tests/ test_processacc epted.py 2010-02-23 10:30:56 +0000 soyuz/tests/ test_processacc epted.py 2010-04-13 11:56:59 +0...
> processed_
>
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/