From 13cbf5f4629808efca56884aa48bbe2d863d4a8d Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Tue, 23 Apr 2024 10:57:47 +0000 Subject: [PATCH] Shut down usage tracking harder This invokes .close() on usage tracking, which releases two fds per sub-process (so 4 for each usage-tracked DFK = 2 x {start, stop}) more immediately. This PR reworks logging around shutdown to emphasise that something is wrong if SIGKILL is needed, and to add a debug line right before a potentially long delay. --- parsl/usage_tracking/usage.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/parsl/usage_tracking/usage.py b/parsl/usage_tracking/usage.py index 01db16bbfb..f37a4e7805 100644 --- a/parsl/usage_tracking/usage.py +++ b/parsl/usage_tracking/usage.py @@ -191,7 +191,10 @@ def close(self, timeout: float = 10.0) -> None: or won't respond to SIGTERM. """ for proc in self.procs: + logger.debug("Joining usage tracking process %s", proc) proc.join(timeout=timeout) if proc.is_alive(): - logger.info("Usage tracking process did not end itself; sending SIGKILL") + logger.warning("Usage tracking process did not end itself; sending SIGKILL") proc.kill() + + proc.close()