Skip to content

Fix: Celery sync/async DB engines are not disposed after worker fork - #123

Open
Zawiszowski wants to merge 1 commit into
the-momentum:mainfrom
Zawiszowski:fix/celery-db
Open

Fix: Celery sync/async DB engines are not disposed after worker fork#123
Zawiszowski wants to merge 1 commit into
the-momentum:mainfrom
Zawiszowski:fix/celery-db

Conversation

@Zawiszowski

@Zawiszowski Zawiszowski commented Aug 21, 2026

Copy link
Copy Markdown

Closes #122

Summary
Celery prefork workers didn't dispose ther inherited DB pool after fork, so children could share the parent's connections instead of building their own. Added a worker_process_init hook that calls dispose(close=False) on both engines so each worker starts with fresh pool.

@Zawiszowski
Zawiszowski marked this pull request as ready for review August 21, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Celery sync/async DB engines are not disposed after worker fork (connection pool inherited across prefork workers)

1 participant