Ferdinanddb commented on issue #77255:
URL: https://github.com/apache/airflow/issues/77255#issuecomment-6987621306

   I'm happy to work on a PR for this. Before I start, could a maintainer 
confirm the direction: restore the documented behaviour (a retry only gets what 
is left of `timeout`), or keep the per-try timeout and update the docs?
   
   If it's the former, here is what I have in mind, from a read of 3.4.0:
   
   1. **Find when the sensor started waiting, across retries.** Retries already 
keep the earlier attempts: `prepare_db_for_next_try` archives the old row with 
`archived_reason="retry"` and keeps its `TaskReschedule` rows, while a clear 
archives it as `"superseded"`. So `ti_run` could compute the start of the 
current window as the first try's start since the last clear, rather than 
looking only at the current `ti_id`, and send it in `TIRunContext` (next to the 
existing `first_task_reschedule_start_date`, probably in a new execution API 
version).
   2. **Reschedule and poke mode:** have `BaseSensorOperator.execute` use that 
start instead of `get_first_reschedule_date`, which would also retire the 
`first_try_number` lookup that no longer works.
   3. **Deferrable mode:** each sensor passes its own `timeout` to `defer()`, 
so rather than touching every provider, cap the deferral timeout in one place 
(e.g. where the task runner handles `TaskDeferred` for sensors) at `timeout` 
minus the time already spent since that start.
   
   Clearing a task would still start a new window, as it does today. Happy to 
adjust if there's a better place for any of this.
   


-- 
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]

Reply via email to