Skip to content

Commit

Permalink
Fixed murder workflow code to represent timeout=None better
Browse files Browse the repository at this point in the history
  • Loading branch information
EnTeQuAk committed Aug 29, 2011
1 parent 70ad76c commit 990dc6b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pistil/arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,15 @@ def murder_workers(self):
"""
for (pid, child_info) in self._WORKERS.items():
(child, state) = child_info
if state:
if state and child.timeout is not None:
try:
diff = time.time() - os.fstat(child.tmp.fileno()).st_ctime
if diff <= child.timeout or child.timeout is None:
if diff <= child.timeout:
continue
except ValueError:
continue
elif state and child.timeout is None:
continue

log.critical("WORKER TIMEOUT (pid:%s)", pid)
self.kill_worker(pid, signal.SIGKILL)
Expand Down

0 comments on commit 990dc6b

Please sign in to comment.