mark as busy before forking horse

main
horida 9 years ago committed by Volker Vorwerk
parent 95f740299a
commit 04987a80da

@ -491,6 +491,7 @@ class Worker(object):
within the given timeout bounds, or will end the work horse with
SIGALRM.
"""
self.set_state('busy')
child_pid = os.fork()
if child_pid == 0:
self.main_work_horse(job)
@ -499,7 +500,6 @@ class Worker(object):
self.procline('Forked {0} at {0}'.format(child_pid, time.time()))
while True:
try:
self.set_state('busy')
os.waitpid(child_pid, 0)
self.set_state('idle')
break

Loading…
Cancel
Save