From 7a5933a77bba05c1b8c48767ae9e4f38b8336bd9 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Mon, 19 Aug 2019 17:52:23 +0800 Subject: [PATCH] Log exit code from dead processes Signed-off-by: Rodrigo Tobar --- dlg/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlg/utils.py b/dlg/utils.py index 384f3cd2e..6c20e1cef 100644 --- a/dlg/utils.py +++ b/dlg/utils.py @@ -380,7 +380,9 @@ def terminate_or_kill(proc, timeout): the given timeout. If the process is still alive after the timeout it is killed. """ - if proc.poll() is not None: + ecode = proc.poll() + if ecode is not None: + logger.info("Process %d already exited with code %d", proc.pid, ecode) return logger.info('Terminating %d', proc.pid) proc.terminate()