summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-08-02 22:10:47 -0700
committerZac Medico <zmedico@gentoo.org>2011-08-02 22:10:47 -0700
commit56099907f2fb5bbf8319baa961f97c9356995c09 (patch)
tree9296831a00eaccfa1ad864f68d28c65ace45ed1e
parentb33f68f8b3ade6531d45ad79c72acbd7f0cb9109 (diff)
downloadportage-56099907f2fb5bbf8319baa961f97c9356995c09.tar.gz
portage-56099907f2fb5bbf8319baa961f97c9356995c09.tar.bz2
portage-56099907f2fb5bbf8319baa961f97c9356995c09.zip
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.
-rw-r--r--pym/_emerge/Scheduler.py7
1 files changed, 7 insertions, 0 deletions
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