Merge lp:~mwhudson/launchpad/back-off-failing-imports-bug-413637 into lp:launchpad/db-devel
| Status: | Rejected | ||||
|---|---|---|---|---|---|
| Rejected by: | Michael Hudson-Doyle on 2010-03-15 | ||||
| Proposed branch: | lp:~mwhudson/launchpad/back-off-failing-imports-bug-413637 | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Diff against target: |
873 lines (+431/-102) 13 files modified
lib/canonical/buildd/debian/launchpad-buildd.init (+1/-1) lib/lp/buildmaster/interfaces/buildfarmjobbehavior.py (+1/-1) lib/lp/buildmaster/model/buildfarmjobbehavior.py (+94/-10) lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py (+80/-8) lib/lp/code/interfaces/codeimportjob.py (+7/-3) lib/lp/code/model/codeimportjob.py (+26/-21) lib/lp/code/model/recipebuilder.py (+11/-2) lib/lp/code/model/tests/test_codeimportjob.py (+25/-0) lib/lp/soyuz/doc/buildd-slavescanner.txt (+4/-3) lib/lp/testing/factory.py (+87/-40) lib/lp/translations/doc/translationtemplatesbuildbehavior.txt (+41/-12) lib/lp/translations/model/translationtemplatesbuildbehavior.py (+17/-1) lib/lp/translations/tests/test_translationtemplatesbuildbehavior.py (+37/-0) |
||||
| To merge this branch: | bzr merge lp:~mwhudson/launchpad/back-off-failing-imports-bug-413637 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Canonical Launchpad Engineering | 2010-03-15 | Pending | |
|
Review via email:
|
|||
Description of the Change
Hi there,
This small branch changes the code import system to exponentially back off on retrying code imports -- see the linked bug for more.
Currently it backs off so that it tries imports at 6, 12, 24 and 48 hours (for subversion) for a total of three and a bit days of trying before marking an import failed -- is that enough? It seems OK, though perhaps a bit on the low side, to me.
Cheers,
mwh
| Jonathan Lange (jml) wrote : | # |
| Michael Hudson-Doyle (mwhudson) wrote : | # |
Jonathan Lange wrote:
> On Mon, Mar 15, 2010 at 10:22 PM, Michael Hudson
> <email address hidden> wrote:
>> Michael Hudson has proposed merging lp:~mwhudson/launchpad/back-off-failing-imports-bug-413637 into lp:launchpad.
>>
>> Requested reviews:
>> Canonical Launchpad Engineering (launchpad)
>> Related bugs:
>> #413637 imports disabled too rapidly
>> https:/
>>
>>
>> Hi there,
>>
>> This small branch changes the code import system to exponentially back off on retrying code imports -- see the linked bug for more.
>>
>
> I think the branch is bigger than you intended. It's got a bunch of
> build farm job stuff in the diff.
Grar grar, it's proposed into db-devel of course.
I proposed again:
https:/
>> Currently it backs off so that it tries imports at 6, 12, 24 and 48 hours (for subversion) for a total of three and a bit days of trying before marking an import failed -- is that enough? It seems OK, though perhaps a bit on the low side, to me.
>>
>
> Sounds fine to me.
>
> ...
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -10,6 +10,8 @@
>> 'CodeImportJobW
>> ]
>>
>> +import datetime
>> +
>> from sqlobject import ForeignKey, IntCol, SQLObjectNotFound, StringCol
>>
>> from zope.component import getUtility
>> @@ -140,7 +142,7 @@
>>
>> implements(
>>
>> - def newJob(self, code_import, date_due=None):
>> + def newJob(self, code_import, interval=None):
>> """See `ICodeImportJob
>> assert code_import.
>> "Review status of %s is not REVIEWED: %s" % (
>> @@ -149,23 +151,22 @@
>> "Already associated to a CodeImportJob: %s" % (
>> code_import.
>>
>> + if interval is None:
>> + interval = code_import.
>> +
>> job = CodeImportJob(
>>
>> - if date_due is None:
>> - # Find the most recent CodeImportResult for this CodeImport. We
>> - # sort by date_created because we do not have an index on
>> - # date_job_started in the database, and that should give the same
>> - # sort order.
>> - most_recent_
>> - code_import=
>> + # Find the most recent CodeImportResult for this CodeImport. We
>> + # sort by date_created because we do not have an index on
>> + # date_job_started in the database, and that should give the same
>> + # sort order.
>> + most_recent_
>> + code_import=
>>
>
> Why aren't you using Storm, with its 'one()' notation for this?
Because all I did to this code was dedent it. I ...

On Mon, Mar 15, 2010 at 10:22 PM, Michael Hudson /bugs.launchpad .net/bugs/ 413637
<email address hidden> wrote:
> Michael Hudson has proposed merging lp:~mwhudson/launchpad/back-off-failing-imports-bug-413637 into lp:launchpad.
>
> Requested reviews:
> Canonical Launchpad Engineering (launchpad)
> Related bugs:
> #413637 imports disabled too rapidly
> https:/
>
>
> Hi there,
>
> This small branch changes the code import system to exponentially back off on retrying code imports -- see the linked bug for more.
>
I think the branch is bigger than you intended. It's got a bunch of
build farm job stuff in the diff.
> Currently it backs off so that it tries imports at 6, 12, 24 and 48 hours (for subversion) for a total of three and a bit days of trying before marking an import failed -- is that enough? It seems OK, though perhaps a bit on the low side, to me.
>
Sounds fine to me.
... code/model/ codeimportjob. py' code/model/ codeimportjob. py 2010-02-24 10:18:16 +0000 code/model/ codeimportjob. py 2010-03-15 22:22:20 +0000 orkflow' , ICodeImportJobW orkflow) Workflow` .""" review_ status == CodeImportRevie wStatus. REVIEWED, ( branch. unique_ name)) effective_ update_ interval code_import= code_import, date_due=UTC_NOW) result_ list = list(CodeImport Result. selectBy( code_import) .orderBy( ['-date_ created' ]).limit( 1)) result_ list = list(CodeImport Result. selectBy( code_import) .orderBy( ['-date_ created' ]).limit( 1))
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -10,6 +10,8 @@
> 'CodeImportJobW
> ]
>
> +import datetime
> +
> from sqlobject import ForeignKey, IntCol, SQLObjectNotFound, StringCol
>
> from zope.component import getUtility
> @@ -140,7 +142,7 @@
>
> implements(
>
> - def newJob(self, code_import, date_due=None):
> + def newJob(self, code_import, interval=None):
> """See `ICodeImportJob
> assert code_import.
> "Review status of %s is not REVIEWED: %s" % (
> @@ -149,23 +151,22 @@
> "Already associated to a CodeImportJob: %s" % (
> code_import.
>
> + if interval is None:
> + interval = code_import.
> +
> job = CodeImportJob(
>
> - if date_due is None:
> - # Find the most recent CodeImportResult for this CodeImport. We
> - # sort by date_created because we do not have an index on
> - # date_job_started in the database, and that should give the same
> - # sort order.
> - most_recent_
> - code_import=
> + # Find the most recent CodeImportResult for this CodeImport. We
> + # sort by date_created because we do not have an index on
> + # date_job_started in the database, and that should give the same
> + # sort order.
> + most_recent_
> + code_import=
>
Why aren't you using Storm, with its 'one()' notation for this?
> @@ -281,15 +282,19 @@ codeimport. consecutive_ failure_ limit consecutive_ failure_ count >= failure_limit: consecutive_ failure_ count.. .
> # If the import has failed too many times in a row, mark it as
> # FAILING.
> failure_limit = config.
> - if code_import.
> + failure_count = code_import.