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
{{ message }}
Repository navigation
fix: open MongoDB clients after the Celery fork #659
Celery prefork children use a MongoClient opened in the parent, because create_celery_app() registers MongoDB before the fork. PyMongo warns MongoClient opened before fork, as a client used across a fork can hang.
Found during the review of #658: the reviewer reproduced the warning in a real worker run. A ForkPoolWorker also logged a warning in the chart log of that PR, but the log cut off before its text, so that instance isn't confirmed to be the same one.
Expected
Worker children open their own client after the fork (e.g., on worker_process_init), or the client isn't opened before the fork. No warning from PyMongo in a worker.
Impact to check
Apps with Celery workers that use MongoDB in tasks, such as proTES, may see tasks hang. Whether this happens in practice has not been checked.
Activity