public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] SpawnProcess: make _cancel kill all processes in cgroup (bug 566414)
@ 2015-11-21 19:18 Zac Medico
  2015-11-23 10:28 ` Alexander Berntsen
  0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-11-21 19:18 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

Since the _cancel method is used to kill subprocesses after die is
called, this fixes die calls in subshells to kill all processes in
the cgroup. For example, see the test ebuild attached to bug 465008,
which would hang for 60 seconds after die was called as follows:

    sleep 60 | ( false || die )

X-Gentoo-Bug: 566414
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=566414
---
 pym/_emerge/SpawnProcess.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pym/_emerge/SpawnProcess.py b/pym/_emerge/SpawnProcess.py
index 5ab2e67..b4b4b5b 100644
--- a/pym/_emerge/SpawnProcess.py
+++ b/pym/_emerge/SpawnProcess.py
@@ -179,7 +179,13 @@ class SpawnProcess(SubProcess):
 
 	def _set_returncode(self, wait_retval):
 		SubProcess._set_returncode(self, wait_retval)
+		self._cgroup_cleanup()
 
+	def _cancel(self):
+		SubProcess._cancel(self)
+		self._cgroup_cleanup()
+
+	def _cgroup_cleanup(self):
 		if self.cgroup:
 			def get_pids(cgroup):
 				try:
-- 
2.4.9



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-portage-dev] [PATCH] SpawnProcess: make _cancel kill all processes in cgroup (bug 566414)
  2015-11-21 19:18 [gentoo-portage-dev] [PATCH] SpawnProcess: make _cancel kill all processes in cgroup (bug 566414) Zac Medico
@ 2015-11-23 10:28 ` Alexander Berntsen
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Berntsen @ 2015-11-23 10:28 UTC (permalink / raw
  To: gentoo-portage-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

LGTM.

- -- 
Alexander
bernalex@gentoo.org
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJWUuoxAAoJENQqWdRUGk8BsS8P/jBjggVVjB3see3RQN/wiBHi
vzs1StQ0mtAeB3VTlW8uL6IvBljUMu3g3VxFB5+1sq9jE9mKbKFGXOU/iuwkKoIt
tLNseVpDWnwKaamFDBFpRbeCA+9w4QiYgdlcbU48wIbQs2pSObpumfLslisnNuEy
LjkwbcoHrf++kCbN3yGzZgSMoD1nSK0zrl5t4Zwf8CFifOeKs3M/Sv31mrhhu+C+
mwGhCupN2gYHKj8zoZqc6lVvWLNujlALz1bLej6A4cSLDgzuE8bRfbNVUrDM5hdo
wsKXxTsMHIdMpjhbZsz2zZfE53gVK6eQlKETZhveX6me7MJ9Zhm+EYHTg1CpRK9L
YtKE0gYszKRdpzTmTU2ZF3stycORUrWCbtg5lyO6ipwaEoBtNuagYAPn+dKjXMzf
WipZeKsgvHITWLLI7U2ci/jkp4Fn+kNBnE5+oFAmSjCpdT0Xy9M8kwz1q3YU7BCQ
Jz/smlmom3NGQqu9A2DXWAi2Ak4Se7Oaj3SuydCnvE6mkaY+pB4D1qlEMA3qc91N
eP3/NCWZeyPGaIsBpQ/kKcREex6zztzYZpzo9Q9wxKc3tbfoMmcVg5LJ/dxAsWC8
wpdaaKtDnK+gURnda6BS2yQ9m9I5BUh5N23sUuavC3W/rZCUosbq15rE42N7yhcH
Bp5yVyvltJ+BXmcF5kFL
=pBUO
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-23 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-21 19:18 [gentoo-portage-dev] [PATCH] SpawnProcess: make _cancel kill all processes in cgroup (bug 566414) Zac Medico
2015-11-23 10:28 ` Alexander Berntsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox