1 |
For subshell die support (bug 465008), we need to re-check cgroup.procs |
2 |
until it's empty, in case any of the listed processes fork before we've |
3 |
had a chance to kill them. |
4 |
|
5 |
X-Gentoo-Bug: 566420 |
6 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566420 |
7 |
--- |
8 |
pym/_emerge/SpawnProcess.py | 11 +++++++---- |
9 |
1 file changed, 7 insertions(+), 4 deletions(-) |
10 |
|
11 |
diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py |
12 |
index 5ab2e67..b27be2f 100644 |
13 |
--- a/pym/_emerge/SpawnProcess.py |
14 |
+++ b/pym/_emerge/SpawnProcess.py |
15 |
@@ -203,10 +203,13 @@ class SpawnProcess(SubProcess): |
16 |
elif e.errno != errno.ESRCH: |
17 |
raise |
18 |
|
19 |
- # step 1: kill all orphans |
20 |
- pids = get_pids(self.cgroup) |
21 |
- if pids: |
22 |
- kill_all(pids, signal.SIGKILL) |
23 |
+ # step 1: kill all orphans (loop in case of new forks) |
24 |
+ while True: |
25 |
+ pids = get_pids(self.cgroup) |
26 |
+ if pids: |
27 |
+ kill_all(pids, signal.SIGKILL) |
28 |
+ else: |
29 |
+ break |
30 |
|
31 |
# step 2: remove the cgroup |
32 |
try: |
33 |
-- |
34 |
2.4.9 |