Skip to content
Snippets Groups Projects
Commit fb2d189c authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix the rsync child process wait code

If the process takes too long to finish after the stdout fd is
closed, kill it.
parent c16850ae
No related branches found
No related tags found
No related merge requests found
......@@ -124,12 +124,19 @@ class Rsync:
progress.success('done')
finally:
run.poll()
if run.returncode is None:
run.send_signal(signal.SIGHUP)
def handler(signum, frame):
run.terminate()
time.sleep(1)
run.poll()
if run.returncode is None:
run.kill()
run.wait()
signal.signal(signal.SIGALRM, handler)
signal.alarm(2)
run.communicate()
signal.alarm(0)
if run.returncode != 0:
raise FatalError("rsync failed")
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment