You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a minimally reproducible testcase (tested against celery 4.4.2):
from celery import Celery
from celery.signals import task_postrun
import numpy as np
app = Celery('tasks', backend='rpc://', broker='pyamqp://guest@rabbit//')
app.conf.task_time_limit = 2
@app.task
def long_running_task():
# this should take a couple of seconds
return np.sum(np.random.rand(20000, 20000))
@task_postrun.connect
def task_postrun_handler(**kwargs):
print("postrun handler", kwargs)
When long_running_task is interrupted with the TimeLimitExceeded exception, it does not run the postrun handler. This seems to happen only if the task is not easily interruptible (e.g. with a heavy numpy calculation instead of a simple while loop).
Here is a minimally reproducible testcase (tested against celery 4.4.2):
When
long_running_task
is interrupted with theTimeLimitExceeded
exception, it does not run the postrun handler. This seems to happen only if the task is not easily interruptible (e.g. with a heavy numpy calculation instead of a simple while loop).Related issue: #4932
The text was updated successfully, but these errors were encountered: