Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Fix issue where worker hangs up startup.
Browse files Browse the repository at this point in the history
See celery#1847 for more details.
  • Loading branch information
bialecki committed Apr 23, 2014
1 parent c9e217a commit 1c2d2a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions celery/worker/loops.py
Expand Up @@ -49,6 +49,11 @@ def asynloop(obj, connection, consumer, blueprint, hub, qos,
if not obj.restart_count and not obj.pool.did_start_ok():
raise WorkerLostError('Could not start worker processes')

# consumer.consume() may have prefetched up to our
# limit - drain an event so we are in a clean state
# prior to starting our event loop.
connection.drain_events()

# FIXME: Use loop.run_forever
# Tried and works, but no time to test properly before release.
hub.propagate_errors = errors
Expand Down

0 comments on commit 1c2d2a7

Please sign in to comment.