Skip to content

Conversation

@kaxil
Copy link
Member

@kaxil kaxil commented Oct 16, 2025

When a deferred task resumed and failed in its completion callback, retries would incorrectly re-execute the callback instead of restarting from the beginning. This caused retry attempts to fail repeatedly at the same step rather than attempting the full task execution from scratch.

The fix ensures next_method and next_kwargs fields are properly cleared when tasks transition to retry, failed, or success states, preventing stale deferral parameters from persisting across task attempts.

Fixes #56704


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

When a deferred task resumed and failed in its completion callback,
retries would incorrectly re-execute the callback instead of restarting
from the beginning. This caused retry attempts to fail repeatedly at the
same step rather than attempting the full task execution from scratch.

The fix ensures next_method and next_kwargs fields are properly cleared
when tasks transition to retry, failed, or success states, preventing
stale deferral parameters from persisting across task attempts.

Fixes apache#56704
@kaxil kaxil added this to the Airflow 3.1.1 milestone Oct 16, 2025
@kaxil kaxil requested a review from tirkarthi October 16, 2025 16:05
@kaxil kaxil added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Oct 16, 2025
@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Oct 16, 2025
Copy link
Contributor

@tirkarthi tirkarthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @kaxil .

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Bug squasher @kaxil

@kaxil kaxil merged commit 16e9b35 into apache:main Oct 16, 2025
109 of 112 checks passed
@kaxil kaxil deleted the fix-retry-deferral branch October 16, 2025 17:01
@kaxil
Copy link
Member Author

kaxil commented Oct 16, 2025

the k8s failure will be fixed by #56733

github-actions bot pushed a commit that referenced this pull request Oct 16, 2025
…ate (#56731)

When a deferred task resumed and failed in its completion callback,
retries would incorrectly re-execute the callback instead of restarting
from the beginning. This caused retry attempts to fail repeatedly at the
same step rather than attempting the full task execution from scratch.

The fix ensures next_method and next_kwargs fields are properly cleared
when tasks transition to retry, failed, or success states, preventing
stale deferral parameters from persisting across task attempts.

Fixes #56704
(cherry picked from commit 16e9b35)

Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
@github-actions
Copy link

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 17, 2025
…56731)

When a deferred task resumed and failed in its completion callback,
retries would incorrectly re-execute the callback instead of restarting
from the beginning. This caused retry attempts to fail repeatedly at the
same step rather than attempting the full task execution from scratch.

The fix ensures next_method and next_kwargs fields are properly cleared
when tasks transition to retry, failed, or success states, preventing
stale deferral parameters from persisting across task attempts.

Fixes apache#56704
abdulrahman305 bot pushed a commit to abdulrahman305/airflow that referenced this pull request Oct 19, 2025
…56731)

When a deferred task resumed and failed in its completion callback,
retries would incorrectly re-execute the callback instead of restarting
from the beginning. This caused retry attempts to fail repeatedly at the
same step rather than attempting the full task execution from scratch.

The fix ensures next_method and next_kwargs fields are properly cleared
when tasks transition to retry, failed, or success states, preventing
stale deferral parameters from persisting across task attempts.

Fixes apache#56704
TyrellHaywood pushed a commit to TyrellHaywood/airflow that referenced this pull request Oct 22, 2025
…56731)

When a deferred task resumed and failed in its completion callback,
retries would incorrectly re-execute the callback instead of restarting
from the beginning. This caused retry attempts to fail repeatedly at the
same step rather than attempting the full task execution from scratch.

The fix ensures next_method and next_kwargs fields are properly cleared
when tasks transition to retry, failed, or success states, preventing
stale deferral parameters from persisting across task attempts.

Fixes apache#56704
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

next_method and next_kwargs are not cleared during retries

4 participants