Use Twisted's thread support instead of the threading module in checkwatches

Bug #491870 reported by Gavin Panella
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Gavin Panella

Bug Description

If only to get Twisted's foot in the door with regards to
checkwatches, the direct use of the threading module in checkwatches
should be replaced by Twisted.

As a first step, the same approach can be taken, which is to update
each bug tracker in a thread. This avoids converting the blocking
networking code in lp.bugs.externalbugtracker, and avoids having to
figure out a clear hand-off between the transactional database code
and the networking code.

However, by getting Twisted in there, and a reactor running, it does
open the door to later conversion, perhaps one bug tracker type at a
time.

The following two articles outline some approaches to running a
limited number of jobs in parallel with Twisted:

  Async Batching with Twisted: A Walkthrough
    http://oubiwann.blogspot.com/2008/06/async-batching-with-twisted-walkthrough.html

  Limiting Parallelism
    http://jcalderone.livejournal.com/24285.html

Sprinkle some deferToThread into the above, et voila.

Related branches

Gavin Panella (allenap)
tags: added: bugwatch
Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 491870] [NEW] Use Twisted's thread support instead of the threading module in checkwatches

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

Gavin Panella wrote:
> Public bug reported:
>
> If only to get Twisted's foot in the door with regards to
> checkwatches, the direct use of the threading module in checkwatches
> should be replaced by Twisted.

The code team is pursuing lp:ampoule, which another approach to
exploiting parallelism in Twisted, using a process pool. It might also
work here.

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

iEYEARECAAYFAksXxpoACgkQ0F+nu1YWqI0YUQCdF9eLxKgrSCRD2tng3MB2aqJ2
t2YAn1gvISy5J+ZMLa/vxhyqAzRi6Eve
=Eane
-----END PGP SIGNATURE-----

Gavin Panella (allenap)
tags: added: story-reliable-bug-syncing
Gavin Panella (allenap)
Changed in malone:
assignee: nobody → Gavin Panella (allenap)
status: Triaged → In Progress
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in malone:
milestone: none → 10.03
status: In Progress → Fix Committed
tags: added: qa-needstesting
Gavin Panella (allenap)
tags: added: qa-ok
removed: qa-needstesting
Gavin Panella (allenap)
Changed in malone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.