Skip to content

Instantly share code, notes, and snippets.

@asfaltboy
Last active November 28, 2019 11:09
Show Gist options
  • Save asfaltboy/81dfde85551b5a9029f8d1b962e5422d to your computer and use it in GitHub Desktop.
Save asfaltboy/81dfde85551b5a9029f8d1b962e5422d to your computer and use it in GitHub Desktop.
A reproduction of worker starvation on result backend failure (see https://github.com/celery/celery/issues/5642)
import time
from celery import Celery
app = Celery(
'my_app',
broker='pyamqp://guest@localhost:5673//',
backend='redis://localhost',
)
app.conf.worker_prefetch_multiplier = 1
app.conf.task_acks_late = True
@app.task
def fail(sleep_time):
time.sleep(sleep_time)
raise Exception('Oh oh')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment