AdityaBhattacharya1 commented on code in PR #70092:
URL: https://github.com/apache/airflow/pull/70092#discussion_r3619683687
##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -1268,7 +1268,8 @@ def next_retry_datetime(self):
delay = timedelta(seconds=delay_backoff_in_seconds)
if self.task.max_retry_delay:
delay = min(self.task.max_retry_delay, delay)
- return self.end_date + delay
+ base = self.end_date if self.end_date is not None else
timezone.utcnow()
Review Comment:
Solid point, this needs fixing.
I'll change it to set self.end_date = timezone.utcnow() once, instead of a
local fallback, so it anchors and the normal backoff math converges the same
way it would for a task that just failed. Since this runs inside an active
session, the mutation flushes on the caller's next commit without
next_retry_datetime() needing a session param of its own.
One trade-off worth flagging explicitly: this persists a synthetic end_date,
so duration/Gantt/API will show a "recovery anchor" timestamp rather than a
real completion time. That's the same decision #12675 made for the set_state()
path. Let me know if that's alright, will implement the changes right away.
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]