1 |
commit: a81460175a441897282b0540cefff8060f2b92dc |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 8 04:16:58 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 8 04:35:30 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a8146017 |
7 |
|
8 |
Scheduler: add queue for ebuild-locks |
9 |
|
10 |
Use a separate queue for ebuild-locks when the merge |
11 |
queue allows more than 1 job (due to parallel-install), |
12 |
since the portage.locks module does not behave as desired |
13 |
if we try to lock the same file multiple times |
14 |
concurrently from the same process. |
15 |
|
16 |
--- |
17 |
pym/_emerge/Scheduler.py | 13 +++++++++++-- |
18 |
1 files changed, 11 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py |
21 |
index 182ad87..6c21c71 100644 |
22 |
--- a/pym/_emerge/Scheduler.py |
23 |
+++ b/pym/_emerge/Scheduler.py |
24 |
@@ -95,7 +95,7 @@ class Scheduler(PollScheduler): |
25 |
__slots__ = ("log_file", "schedule") |
26 |
|
27 |
_task_queues_class = slot_dict_class( |
28 |
- ("merge", "jobs", "fetch", "unpack"), prefix="") |
29 |
+ ("merge", "jobs", "ebuild_locks", "fetch", "unpack"), prefix="") |
30 |
|
31 |
class _build_opts_class(SlotObject): |
32 |
__slots__ = ("buildpkg", "buildpkgonly", |
33 |
@@ -565,7 +565,16 @@ class Scheduler(PollScheduler): |
34 |
Schedule a setup phase on the merge queue, in order to |
35 |
serialize unsandboxed access to the live filesystem. |
36 |
""" |
37 |
- self._task_queues.merge.add(setup_phase) |
38 |
+ if self._task_queues.merge.max_jobs > 1 and \ |
39 |
+ "ebuild-locks" in self.settings.features: |
40 |
+ # Use a separate queue for ebuild-locks when the merge |
41 |
+ # queue allows more than 1 job (due to parallel-install), |
42 |
+ # since the portage.locks module does not behave as desired |
43 |
+ # if we try to lock the same file multiple times |
44 |
+ # concurrently from the same process. |
45 |
+ self._task_queues.ebuild_locks.add(setup_phase) |
46 |
+ else: |
47 |
+ self._task_queues.merge.add(setup_phase) |
48 |
self._schedule() |
49 |
|
50 |
def _schedule_unpack(self, unpack_phase): |