1 |
Since the _cancel method is used to kill subprocesses after die is |
2 |
called, this fixes die calls in subshells to kill all processes in |
3 |
the cgroup. For example, see the test ebuild attached to bug 465008, |
4 |
which would hang for 60 seconds after die was called as follows: |
5 |
|
6 |
sleep 60 | ( false || die ) |
7 |
|
8 |
X-Gentoo-Bug: 566414 |
9 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566414 |
10 |
--- |
11 |
pym/_emerge/SpawnProcess.py | 6 ++++++ |
12 |
1 file changed, 6 insertions(+) |
13 |
|
14 |
diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py |
15 |
index 5ab2e67..b4b4b5b 100644 |
16 |
--- a/pym/_emerge/SpawnProcess.py |
17 |
+++ b/pym/_emerge/SpawnProcess.py |
18 |
@@ -179,7 +179,13 @@ class SpawnProcess(SubProcess): |
19 |
|
20 |
def _set_returncode(self, wait_retval): |
21 |
SubProcess._set_returncode(self, wait_retval) |
22 |
+ self._cgroup_cleanup() |
23 |
|
24 |
+ def _cancel(self): |
25 |
+ SubProcess._cancel(self) |
26 |
+ self._cgroup_cleanup() |
27 |
+ |
28 |
+ def _cgroup_cleanup(self): |
29 |
if self.cgroup: |
30 |
def get_pids(cgroup): |
31 |
try: |
32 |
-- |
33 |
2.4.9 |