From 8b5b5186965c47605ba004d317e8fd58e70e97cd Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 3 Aug 2024 14:33:41 -0700 Subject: _EbuildFetcherProcess: Handle SIGTERM Fix _EbuildFetcherProcess to handle SIGTERM, so that FETCHCOMMAND processes will not be left running in the background: * Convert the fetch function to an async_fetch coroutine function so that it can use asyncio.CancelledError handlers to terminate running processes. * Use multiprocessing.active_children() to detect and terminate any processes that asyncio.CancelledError handlers did not have an opportunity to terminate because the exception arrived too soon after fork/spawn. * Add unit test to verify that a child process is correctly killed when EbuildFetcher is cancelled, with short timeout in case it takes some time for the process to disappear. Bug: https://bugs.gentoo.org/936273 Signed-off-by: Zac Medico --- NEWS | 3 +++ 1 file changed, 3 insertions(+) (limited to 'NEWS') diff --git a/NEWS b/NEWS index 04ce6069d..3b7134950 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,9 @@ Bug fixes: * repository: config: Allow a repository to be configured using one of its aliases rather than its primary name (bug #935830). +* emerge: Fix parallel-fetch to properly terminate FETCOMMAND processes when + needed, using a SIGTERM handler (bug #936273). + portage-3.0.65 (2024-06-04) -------------- -- cgit v1.2.3-65-gdbad