Repository navigation
Conversation
Expose forkserver through the worker setting and CLI on Linux and macOS. Leave application preloading disabled and cover task dispatch after the pool has used all its children. Part of celery#11096.
This was referenced Nov 28, 2026
tzifudzi
marked this pull request as ready for review
November 28, 2026 22:34
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Celery’s prefork pool offers
forkandspawnbut doesn’t offerforkserver. Billiard supportsforkserver, and theforkservermode became the defaultmultiprocessingstart method on Linux in Python 3.14, released October 7, 2025.forkservermatters for use cases where forking from a process other than the parent is desirable. For example, when pool children need to avoid inheriting fork-unsafe state, such as gRPC clients initialized by the main worker,forkserverforks them from a separate server process.Solution
Add
forkserveras an opt-in start method for Celery’s prefork pool on Linux and macOS. Users can select it in their configuration or on the command line.Configuration (
celeryconfig.py)CLI
Related PRs
Report the parent's fd numbers from forkserver pool workers celery/billiard #483
Restart the fork server if it dies celery/billiard #484
Replace the fork server on pool restart celery/billiard #485
Support preloading modules in the fork server celery/celery #11178