Merge pull request #457 from jlopex/block_until_horse_finishes

Make parent worker process wait until horse process finishes
This commit is contained in:
Selwin Ong 2015-01-12 14:59:56 +07:00
commit eae2c40ea0
1 changed files with 2 additions and 0 deletions

View File

@ -473,7 +473,9 @@ class Worker(object):
self.procline('Forked %d at %d' % (child_pid, time.time())) self.procline('Forked %d at %d' % (child_pid, time.time()))
while True: while True:
try: try:
self.set_state('busy')
os.waitpid(child_pid, 0) os.waitpid(child_pid, 0)
self.set_state('idle')
break break
except OSError as e: except OSError as e:
# In case we encountered an OSError due to EINTR (which is # In case we encountered an OSError due to EINTR (which is