Repository navigation
Fix plugin registration returning early on duplicate names in Task SDK - #72253
Merged
potiuk merged 1 commit intoAug 29, 2026
Merged
Conversation
__register_plugins used `return` instead of `continue` when encountering a duplicate plugin name, so the first duplicate abandoned the rest of the batch and every plugin after it was silently dropped. airflow-core carries a duplicate of this function and was fixed twice: in apache#60498 (`return` became a warning plus `continue`) and in apache#66649 (also record the duplicate in import_errors). Neither fix reached the Task SDK copy. Because that copy is the one used by the task-running process, plugins would load for the scheduler and API server but silently go missing inside tasks - most visibly, task instance listeners registered by a plugin would never fire. The __register_plugins body is now byte-identical to the airflow-core one.
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
potiuk
approved these changes
Aug 29, 2026
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
apache#72253) __register_plugins used `return` instead of `continue` when encountering a duplicate plugin name, so the first duplicate abandoned the rest of the batch and every plugin after it was silently dropped. airflow-core carries a duplicate of this function and was fixed twice: in apache#60498 (`return` became a warning plus `continue`) and in apache#66649 (also record the duplicate in import_errors). Neither fix reached the Task SDK copy. Because that copy is the one used by the task-running process, plugins would load for the scheduler and API server but silently go missing inside tasks - most visibly, task instance listeners registered by a plugin would never fire. The __register_plugins body is now byte-identical to the airflow-core one.
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.
__register_pluginsintask-sdk/src/airflow/sdk/plugins_manager.pyusesreturnwhere it meanscontinue:The first duplicate plugin name therefore abandons the rest of the batch, and every plugin after it is
dropped — silently, since nothing is logged and
_get_plugins()still returns an emptyimport_errors.airflow-corecarries a copy of this function and fixed it in #60498, then hardened it in #66649 (recordthe duplicate in
import_errors). Neither fix reached the Task SDK copy. This PR applies both, so theblock becomes byte-identical to the core one.
It matters because the Task SDK copy is the one the task-running process uses. While the two disagree,
plugins load for the scheduler and API server but go missing inside tasks — most sharply, a plugin
registering
on_task_instance_running/on_task_instance_failedafter a duplicate name never fires,with no error anywhere to attribute it to. Duplicate names are not exotic: the same plugin shipped both
flattened and as a package, or present in the plugins folder and as an entry point, is enough.
Covered by a new
task-sdk/tests/task_sdk/test_plugins_manager.pycarrying the two cases the core suitealready has for this branch; both fail on
mainand pass with the change.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.