Skip to content

Commit

Permalink
Log exit code from dead processes
Browse files Browse the repository at this point in the history
Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Aug 19, 2019
1 parent 068eb14 commit 7a5933a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dlg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7a5933a

Please sign in to comment.