Merge lp:~mwhudson/launchpad/puller-scheduler-aaaaaaaaaaaargh into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/puller-scheduler-aaaaaaaaaaaargh
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~mwhudson/launchpad/puller-scheduler-aaaaaaaaaaaargh
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+9812@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi Tim,

Testing this damn puller stuff on staging, it's still not quite right: if we ask for work and don't get anything, we should only stop the source if no jobs are running, otherwise we get the problem we've always had with the puller, where a long running job stops all pulling for a while.

I've tested this patch on staging and it works nicely (while a mirror branch was in the process of being pulled I pushed up a hosted branch and it was pulled within seconds).

Cheers,
mwh

Revision history for this message
Tim Penhey (thumper) wrote :

On Fri, 07 Aug 2009 12:50:18 Michael Hudson wrote:
> I've tested this patch on staging and it works nicely (while a mirror
> branch was in the process of being pulled I pushed up a hosted branch and
> it was pulled within seconds).

We used to have one puller for mirrored branches and one for hosted. Has this
changed now?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Tim Penhey wrote:
> On Fri, 07 Aug 2009 12:50:18 Michael Hudson wrote:
>> I've tested this patch on staging and it works nicely (while a mirror
>> branch was in the process of being pulled I pushed up a hosted branch and
>> it was pulled within seconds).
>
> We used to have one puller for mirrored branches and one for hosted. Has this
> changed now?

Yes. We could probably separate them out again, but I don't really
think there's much point.

Cheers,
mwh

Revision history for this message
Tim Penhey (thumper) wrote :

On Fri, 07 Aug 2009 13:21:07 Michael Hudson wrote:
> Tim Penhey wrote:
> > On Fri, 07 Aug 2009 12:50:18 Michael Hudson wrote:
> >> I've tested this patch on staging and it works nicely (while a mirror
> >> branch was in the process of being pulled I pushed up a hosted branch
> >> and it was pulled within seconds).
> >
> > We used to have one puller for mirrored branches and one for hosted. Has
> > this changed now?
>
> Yes. We could probably separate them out again, but I don't really
> think there's much point.
>
> Cheers,
> mwh

 merge approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/twistedsupport/task.py'
2--- lib/canonical/twistedsupport/task.py 2009-08-06 10:47:18 +0000
3+++ lib/canonical/twistedsupport/task.py 2009-08-07 00:33:44 +0000
4@@ -246,7 +246,8 @@
5 find any jobs, if we actually start any jobs then the exit condition
6 in _taskEnded will always be reached before this one.
7 """
8- self._stop()
9+ if self._worker_count == 0:
10+ self._stop()
11
12 def taskProductionFailed(self, reason):
13 """See `ITaskConsumer`.
14
15=== modified file 'lib/canonical/twistedsupport/tests/test_task.py'
16--- lib/canonical/twistedsupport/tests/test_task.py 2009-08-06 10:47:18 +0000
17+++ lib/canonical/twistedsupport/tests/test_task.py 2009-08-07 00:33:44 +0000
18@@ -509,6 +509,16 @@
19 consumer.noTasksFound()
20 self.assertEqual([], task_log)
21
22+ def test_source_not_stopped_if_no_tasks_found_and_job_running(self):
23+ # If no tasks are found while a job is running, we do not stop the
24+ # source.
25+ consumer = self.makeConsumer()
26+ log = []
27+ consumer.consume(LoggingSource(log))
28+ consumer.taskStarted(self._neverEndingTask)
29+ consumer.noTasksFound()
30+ self.assertEqual(0, log.count('stop'))
31+
32 def test_source_stopped_when_tasks_done(self):
33 # When no more tasks are running, we stop the task source.
34 consumer = self.makeConsumer()