Skip to content

fix: ensure Celery tasks are registered at worker startup (main)#63110

Merged
potiuk merged 5 commits intoapache:mainfrom
kalluripradeep:fix-celery-executor-task-registration-main
Mar 9, 2026
Merged

fix: ensure Celery tasks are registered at worker startup (main)#63110
potiuk merged 5 commits intoapache:mainfrom
kalluripradeep:fix-celery-executor-task-registration-main

Conversation

@kalluripradeep
Copy link
Contributor

Follow-up to #63050

When the Celery worker starts, it imports app from celery_executor.py but celery_executor_utils.py was never imported at module level. This means execute_workload (and execute_command for Airflow 2.x) are never registered as Celery tasks when the worker boots, causing:

KeyError: 'execute_command'
KeyError: 'execute_workload'
Received unregistered task of type '...'. The message has been ignored and discarded.

Fix is a single module-level import in celery_executor.py so celery_executor_utils is loaded when the worker imports app at startup, ensuring all tasks are registered immediately.

Also adds a regression test to verify task registration on import.

Fixes #63043

@kalluripradeep kalluripradeep force-pushed the fix-celery-executor-task-registration-main branch from d873815 to bc66eb4 Compare March 8, 2026 21:08
@eladkal eladkal requested a review from potiuk March 9, 2026 13:44
@potiuk
Copy link
Member

potiuk commented Mar 9, 2026

Nice ! Thanks @kalluripradeep !

@potiuk potiuk merged commit 68fce1b into apache:main Mar 9, 2026
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Celery provider 3.17.0 also breaks Airflow 2.11

3 participants