ExternalTask: Check if the most recent task succeeds #38185
Replies: 3 comments
-
Thanks for opening your first issue here! Be sure to follow the issue template! |
Beta Was this translation helpful? Give feedback.
-
Needs to define “recent”. What time should be used to compare runs—logical time, trigger time, finish time, or otherwise? Does this include manually triggered runs? If so, how should the times between manual and scheduled runs be compared? |
Beta Was this translation helpful? Give feedback.
-
First, estimate the usecase for the most recent run, as opposed to ExternalTaskSensor, which looks for a run at a specific logical time. The usecase in question isn't worried about historical runs, meaning that the most recent contains all the data and references desired. Second, compare OPs request to the current version of the ExternalTaskSensor class, and the usecase presented.
The logical time. That's how the current class does it.
It doesn't look like the current class differentiates, so this one probably shouldn't either. Remember the most recent run (logical time-wise) contains all the references needed. If the logical time on a manual run is later than the logical time on any scheduled run, then the manual run is likely the one desired. |
Beta Was this translation helpful? Give feedback.
-
Description
A sensor that only relies on the most recent run to be in
allowed_states
instead of using aexecution_delta
orexecution_delta_fn
.I can think of couple potential issues with this:
task_instance
tables based onexecution_date
, can be expensiveallowed_states
, and when sensor retries, the previous task that we are supposed to check is in aallowed_states
, but there is a new task being scheduled and is not inallowed_states
again.Any thoughts?
Use case/motivation
A sensor that only relies on the most recent run to be in
allowed_states
instead of using aexecution_delta
orexecution_delta_fn
.Related issues
No response
Are you willing to submit a PR?
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions