parent
d303b794f3
commit
2e7e75a27c
2 changed files with 15 additions and 1 deletions
|
@ -52,7 +52,19 @@ def execute(
|
|||
raise RuntimeError("{} not found".format(cmd))
|
||||
|
||||
if wait:
|
||||
out, _ = proc.communicate()
|
||||
timeout = 60
|
||||
try:
|
||||
out, _ = proc.communicate(timeout=timeout)
|
||||
except subprocess.TimeoutExpired as e:
|
||||
logging.warning(
|
||||
f"""
|
||||
Communication with process pid={proc.pid} hangs for more
|
||||
than {timeout} seconds.
|
||||
If this is not expected, the process is stale, or
|
||||
you might have run in stdout / stderr deadlock.
|
||||
"""
|
||||
)
|
||||
out, _ = proc.communicate()
|
||||
if proc.returncode != 0:
|
||||
err = "{} exited with code {}".format(cmd, proc.returncode)
|
||||
logging.warning(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue