Skip to content

Commit

Permalink
Backport 0.4 handling of workers after death
Browse files Browse the repository at this point in the history
  • Loading branch information
sideshowdave7 committed Aug 11, 2017
1 parent c2ce431 commit 4e4e013
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions eventmq/jobmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ def _start_event_loop(self):
Starts the actual event loop. Usually called by :meth:`start`
"""
# Acknowledgment has come
# When the job manager unexpectedly disconnects from the router and
# reconnects it needs to send a ready for each previously available
# worker.
# Send a READY for each previously available worker
if hasattr(self, '_workers'):
for _ in self._workers:
self.send_ready()

self.status = STATUS.running

try:
Expand Down Expand Up @@ -218,6 +210,14 @@ def _start_event_loop(self):
except Exception:
logger.exception("Unhandled exception in main jobmanager loop")

# Cleanup
del self._workers

# Flush the queues with workers
self.request_queue = mp_queue()
self.finished_queue = mp_queue()
logger.info("Reached end of event loop")

def handle_response(self, resp):
"""
Handles a response from a worker process to the jobmanager
Expand Down

0 comments on commit 4e4e013

Please sign in to comment.