Ensure async terminates when time limit is not divisible by 5

Because async_wrapper subtracts 5 from time_limit and checks for
equality to zero, values not divisible by 5 will go negative and
continue forever.
This commit is contained in:
willthames 2013-11-05 09:42:28 +10:00
parent ac3baf2f93
commit 91b827768d

View file

@ -180,7 +180,7 @@ try:
debug("%s still running (%s)"%(sub_pid, remaining))
time.sleep(5)
remaining = remaining - 5
if remaining == 0:
if remaining <= 0:
debug("Now killing %s"%(sub_pid))
os.killpg(sub_pid, signal.SIGKILL)
debug("Sent kill to group %s"%sub_pid)