From 56099907f2fb5bbf8319baa961f97c9356995c09 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 2 Aug 2011 22:10:47 -0700 Subject: [PATCH] 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. --- pym/_emerge/Scheduler.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.26.2