Add duplicate hostname check for Celery workers#58591
Merged
jscheffl merged 2 commits intoapache:mainfrom Nov 23, 2025
Merged
Conversation
Prevent launching a new Celery worker if another worker with the same hostname is already running. The check queries active workers via the Celery inspect API and raises an error if a worker with the specified hostname already exists. This prevents confusion and potential conflicts from having multiple workers with identical hostnames
Member
Author
jscheffl
approved these changes
Nov 23, 2025
Member
|
Nice! |
This was referenced Nov 27, 2025
Copilot AI
pushed a commit
to jason810496/airflow
that referenced
this pull request
Dec 5, 2025
* Add duplicate hostname check for Celery workers Prevent launching a new Celery worker if another worker with the same hostname is already running. The check queries active workers via the Celery inspect API and raises an error if a worker with the specified hostname already exists. This prevents confusion and potential conflicts from having multiple workers with identical hostnames * Fix tests
itayweb
pushed a commit
to itayweb/airflow
that referenced
this pull request
Dec 6, 2025
* Add duplicate hostname check for Celery workers Prevent launching a new Celery worker if another worker with the same hostname is already running. The check queries active workers via the Celery inspect API and raises an error if a worker with the specified hostname already exists. This prevents confusion and potential conflicts from having multiple workers with identical hostnames * Fix tests
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Mar 4, 2026
* Add duplicate hostname check for Celery workers Prevent launching a new Celery worker if another worker with the same hostname is already running. The check queries active workers via the Celery inspect API and raises an error if a worker with the specified hostname already exists. This prevents confusion and potential conflicts from having multiple workers with identical hostnames * Fix tests
shivaam
added a commit
to shivaam/airflow
that referenced
this pull request
Mar 21, 2026
The duplicate hostname check (added in apache#58591) calls celery_app.control.inspect().active_queues() which lazily initializes celery_app.amqp._producer_pool. When worker_main() subsequently forks prefork pool workers, children inherit this stale producer pool with the parent's Redis connection, breaking consumer-to-pool task dispatch. Reset _producer_pool to None after the inspect block so worker_main() initializes it fresh in the correct process context after forking. closes: apache#59707
2 tasks
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.
Prevent launching a new Celery worker if another worker with the same
hostname is already running. The check queries active workers via the
Celery inspect API and raises an error if a worker with the specified
hostname already exists.
This prevents confusion and potential conflicts from having multiple
workers with identical hostnames