Mark KubernetesPodOperator and AgentOperator as durable capable - #70289
Merged
amoghrajesh merged 3 commits intoJul 24, 2026
Merged
Conversation
amoghrajesh
requested review from
Lee-W,
gopidesupavan,
hussein-awala,
jedcunningham,
jscheffl and
kaxil
as code owners
July 23, 2026 08:58
amoghrajesh
marked this pull request as draft
July 23, 2026 09:14
amoghrajesh
marked this pull request as ready for review
July 23, 2026 09:29
1 task
Lee-W
approved these changes
Jul 23, 2026
phanikumv
reviewed
Jul 23, 2026
phanikumv
reviewed
Jul 23, 2026
phanikumv
approved these changes
Jul 24, 2026
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.
Was generative AI tooling used to co-author this PR?
What
Enhancement to: #69651, where the Airflow Registry added a
supports_durable_executionsignal (built on top ofResumableJobMixin), badging operators that survive a worker crash/retry without redoing expensive work.KubernetesPodOperator(#69914) andAgentOperator(common.ai) both already implement this same crash-safe property, but neither inheritsResumableJobMixin-- they implement it directly againsttask_state_store, since their own execution shapes (pod lifecycle management, LLM step/tool-call replay caching) don't fit the mixin's submit/poll/result contract.The registry detection is purely MRO-based, so both operators are currently invisible to it despite genuinely qualifying.
Proposed change
Adds
__supports_durable_execution: ClassVar[bool] = Truedirectly to both operator classes, indicating that durable execution is implemented directly here, not viaResumableJobMixin. This is a plain class attribute, not a new mixin or shared marker class -- there's no common contract between pod-lifecycle management and LLM-call caching to anchor a reusable base class on, so a class-level declaration is the simplest correct signal.The name uses a double leading underscore deliberately, not a single one. Python name-mangles it to
_KubernetesPodOperator__supports_durable_execution/_AgentOperator__supports_durable_executionon each declaring class. This matters because both operators have subclasses that overrideexecute()themselves (e.g.SparkKubernetesOperator,KubernetesJobOperator,KubernetesStartKueueJobOperatorfor KPO) -- we have no way to verify those subclasses preserve thetask_state_storereconnect behavior, so the attribute must not be treated as true for them just because they inherit from a durable-capable parent. A subclass that doesn't redeclare the attribute in its own class body will not match a per-class mangled-name lookup, unlike a plain single-underscore attribute, which would be silently inherited by every subclass regardless of whether it actually preserves the mechanism.Changes of Note
This attribute is not read by anything yet. It will be a follow-up change, not part of this PR.
What's next
A follow-up change to
dev/registry/extract_parameters.py'sis_durable_capable()to also treat__supports_durable_execution = Trueas qualifying. The check must compute the mangled attribute name per class being inspected (f"_{cls.__name__}__supports_durable_execution") rather than a fixed string, so it only matches a class that declares the attribute itself, not one that merely inherits from a durable-capable base.{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.