django-celery-results icon indicating copy to clipboard operation
django-celery-results copied to clipboard

Check and drop if stale connection when saving task result in db

Open lode-braced opened this issue 1 month ago • 1 comments

lode-braced avatar Dec 10 '25 12:12 lode-braced

@auvipy the copilot description beat me to the punch: I noticed some of our very long running celery tasks getting this exception - the work they do is not on the db connection of the task thread, and so that connection remains idle until the end of the task, at which point the server already kicked it off for being idle for too long. Main consequence is that I had to modify the tests to run outside of the usual pytest-django transaction, since the connection dropping does not play nice with being inside a transaction.

lode-braced avatar Dec 10 '25 16:12 lode-braced