From: Zac Medico Date: Wed, 3 Aug 2011 05:10:47 +0000 (-0700) Subject: Scheduler: fix parallel-fetch order with --jobs=1 X-Git-Tag: v2.2.0_alpha51~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=56099907f2fb5bbf8319baa961f97c9356995c09;p=portage.git Scheduler: fix parallel-fetch order with --jobs=1 This avoids a case where the first prefetcher is discarded, causing the second prefetcher to occupy the fetch queue before the first fetcher has an opportunity to execute. --- diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index d13e62266..6412d821d 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -752,6 +752,13 @@ class Scheduler(PollScheduler): self._task_queues.fetch.add(prefetcher) prefetchers[pkg] = prefetcher + # Start the first prefetcher immediately so that self._task() + # won't discard it. This avoids a case where the first + # prefetcher is discarded, causing the second prefetcher to + # occupy the fetch queue before the first fetcher has an + # opportunity to execute. + self._task_queues.fetch.schedule() + def _create_prefetcher(self, pkg): """ @return: a prefetcher, or None if not applicable