Merge lp:~vila/udd/717109-create-import-jobs-backlog into lp:udd

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: 396
Proposed branch: lp:~vila/udd/717109-create-import-jobs-backlog
Merge into: lp:udd
Diff against target: 40 lines (+17/-9)
1 file modified
icommon.py (+17/-9)
To merge this branch: bzr merge lp:~vila/udd/717109-create-import-jobs-backlog
Reviewer Review Type Date Requested Status
James Westby Approve
Review via email: mp+49406@code.launchpad.net

Description of the change

This fixes bug #717109 so we can re-start a package importer from scratch.

This should be enough to seed the importer.

Adding a command-line option may be a nice followup but I don't need it for now.

To post a comment you must log in.
Revision history for this message
James Westby (james-w) :
review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2/11/2011 9:35 AM, Vincent Ladeuil wrote:
> Vincent Ladeuil has proposed merging lp:~vila/udd/717109-create-import-jobs-backlog into lp:udd.
>
> Requested reviews:
> Ubuntu Distributed Development Developers (udd)
> Related bugs:
> #717109 lp timeout when trying to start a package importer from scratch
> https://bugs.launchpad.net/bugs/717109
>
> For more details, see:
> https://code.launchpad.net/~vila/udd/717109-create-import-jobs-backlog/+merge/49406
>
> This fixes bug #717109 so we can re-start a package importer from scratch.
>
> This should be enough to seed the importer.
>
> Adding a command-line option may be a nice followup but I don't need it for now.

I know James approved this. But I did send this earlier:
As I mentioned on the bug, this is dangerous because it creates a window
where there can be packages that were uploaded but will never be seen.

The fact that future updates will cause us to go back and import them
means this shouldn't be a data-loss situation, but I'm uncomfortable
with it.

Apparently "status: needs_information" rejects the whole message.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1Vfc8ACgkQJdeBCYSNAAMcgwCffeI5c4Z5rZQ5HYncr9+qsZ2G
uq0AoKv5rmReLo3eUYmw5RpBS4GOz43P
=eFlx
-----END PGP SIGNATURE-----

Revision history for this message
Robert Collins (lifeless) wrote :

Did you file an LP bug about the timeout? And include the OOPS?

Revision history for this message
Vincent Ladeuil (vila) wrote :

@John: As mentioned in the bug, this script is mostly to seed the p-i, as soon as a package enters the p-i, all its uploads are caught up. From James explanation, I understand that this is how the p-i has been seeded in the past so if the approach is wrong this needs to be addressed but this mp was about unblocking the situation with the *current* approach.

@Robert: I didn't but this is not urgent anymore and the request against lp may not be ideal anyway. I'll track it better the next time I'll work in this area.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'icommon.py'
2--- icommon.py 2011-02-08 02:58:52 +0000
3+++ icommon.py 2011-02-11 15:35:23 +0000
4@@ -344,20 +344,28 @@
5 last_known_published = status_db.last_import_time()
6 last_published_call = None
7 if last_known_published is not None:
8- last_known_published = \
9- last_known_published - datetime.timedelta(0, 600)
10- last_published_call = last_known_published.isoformat()
11+ last_known_published = (last_known_published
12+ - datetime.timedelta(0, 600))
13+ else:
14+ # When starting from scratch, limit the query to the last ten days or
15+ # lp timeout (https://bugs.launchpad.net/udd/+bug/717109)
16+ last_known_published = (datetime.datetime.now()
17+ - datetime.timedelta(0, 10 * 24 * 3600))
18+ last_published_call = last_known_published.isoformat()
19 # We want all the new Published records since the last run
20 publications = set()
21- for p in iterate_collection(lp_call(call_with_limited_size,
22- lp.distributions['ubuntu'].main_archive.getPublishedSources,
23- status="Published",
24- created_since_date=last_published_call)):
25+ collection = lp_call(
26+ call_with_limited_size,
27+ lp.distributions['ubuntu'].main_archive.getPublishedSources,
28+ status="Published",
29+ created_since_date=last_published_call)
30+ for p in iterate_collection(collection):
31 publications.add(p)
32- for p in iterate_collection(lp_call(call_with_limited_size,
33+ collection = lp_call(call_with_limited_size,
34 lp.distributions['debian'].main_archive.getPublishedSources,
35 status="Pending",
36- created_since_date=last_published_call)):
37+ created_since_date=last_published_call)
38+ for p in iterate_collection(collection):
39 publications.add(p)
40 import_from_publications(status_db, publications, last_known_published)
41

Subscribers

People subscribed via source and target branches