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
=== modified file 'icommon.py'
--- icommon.py 2011-02-08 02:58:52 +0000
+++ icommon.py 2011-02-11 15:35:23 +0000
@@ -344,20 +344,28 @@
344 last_known_published = status_db.last_import_time()344 last_known_published = status_db.last_import_time()
345 last_published_call = None345 last_published_call = None
346 if last_known_published is not None:346 if last_known_published is not None:
347 last_known_published = \347 last_known_published = (last_known_published
348 last_known_published - datetime.timedelta(0, 600)348 - datetime.timedelta(0, 600))
349 last_published_call = last_known_published.isoformat()349 else:
350 # When starting from scratch, limit the query to the last ten days or
351 # lp timeout (https://bugs.launchpad.net/udd/+bug/717109)
352 last_known_published = (datetime.datetime.now()
353 - datetime.timedelta(0, 10 * 24 * 3600))
354 last_published_call = last_known_published.isoformat()
350 # We want all the new Published records since the last run355 # We want all the new Published records since the last run
351 publications = set()356 publications = set()
352 for p in iterate_collection(lp_call(call_with_limited_size,357 collection = lp_call(
353 lp.distributions['ubuntu'].main_archive.getPublishedSources,358 call_with_limited_size,
354 status="Published",359 lp.distributions['ubuntu'].main_archive.getPublishedSources,
355 created_since_date=last_published_call)):360 status="Published",
361 created_since_date=last_published_call)
362 for p in iterate_collection(collection):
356 publications.add(p)363 publications.add(p)
357 for p in iterate_collection(lp_call(call_with_limited_size,364 collection = lp_call(call_with_limited_size,
358 lp.distributions['debian'].main_archive.getPublishedSources,365 lp.distributions['debian'].main_archive.getPublishedSources,
359 status="Pending",366 status="Pending",
360 created_since_date=last_published_call)):367 created_since_date=last_published_call)
368 for p in iterate_collection(collection):
361 publications.add(p)369 publications.add(p)
362 import_from_publications(status_db, publications, last_known_published)370 import_from_publications(status_db, publications, last_known_published)
363371

Subscribers

People subscribed via source and target branches