summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-07 21:16:58 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-07 21:35:30 -0700
commita81460175a441897282b0540cefff8060f2b92dc (patch)
tree5881508046cb10ee37eea9f0df500289181137c5
parent2a90c6f5debe3f18da3317f47dfb144c559fb920 (diff)
downloadportage-a81460175a441897282b0540cefff8060f2b92dc.tar.gz
portage-a81460175a441897282b0540cefff8060f2b92dc.tar.bz2
portage-a81460175a441897282b0540cefff8060f2b92dc.zip
Scheduler: add queue for ebuild-locks
Use a separate queue for ebuild-locks when the merge queue allows more than 1 job (due to parallel-install), since the portage.locks module does not behave as desired if we try to lock the same file multiple times concurrently from the same process.
-rw-r--r--pym/_emerge/Scheduler.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 182ad8771..6c21c711e 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -95,7 +95,7 @@ class Scheduler(PollScheduler):
__slots__ = ("log_file", "schedule")
_task_queues_class = slot_dict_class(
- ("merge", "jobs", "fetch", "unpack"), prefix="")
+ ("merge", "jobs", "ebuild_locks", "fetch", "unpack"), prefix="")
class _build_opts_class(SlotObject):
__slots__ = ("buildpkg", "buildpkgonly",
@@ -565,7 +565,16 @@ class Scheduler(PollScheduler):
Schedule a setup phase on the merge queue, in order to
serialize unsandboxed access to the live filesystem.
"""
- self._task_queues.merge.add(setup_phase)
+ if self._task_queues.merge.max_jobs > 1 and \
+ "ebuild-locks" in self.settings.features:
+ # Use a separate queue for ebuild-locks when the merge
+ # queue allows more than 1 job (due to parallel-install),
+ # since the portage.locks module does not behave as desired
+ # if we try to lock the same file multiple times
+ # concurrently from the same process.
+ self._task_queues.ebuild_locks.add(setup_phase)
+ else:
+ self._task_queues.merge.add(setup_phase)
self._schedule()
def _schedule_unpack(self, unpack_phase):