ferruzzi commented on PR #62918: URL: https://github.com/apache/airflow/pull/62918#issuecomment-4034777638
No, not quite the answer we need here. When you call `prune_deadlines`, it removes that deadline from the list and you'll never get alerted of the miss. In your example with the Dag that failed after 10 minutes, the Dag's `end_date` will now be before the `deadline_time`, so the `deadline` will be removed from the table, never to be called. This is the exact opposite of what should happen. The right fix would be: when the DagRun transitions to `FAILED`, short-circuit by immediately calling `handle_miss()` on any pending (`missed=False`) deadlines for that DagRun, rather than waiting for `deadline_time` to elapse. That way when your Dag fails at 10 minutes, your callback fires immediately, informing the user. You can keep the change you made, but you'll have to wrap the new location in a state check to only call prune on SUCCESS and also add a block for state==FAILED to call handle_miss as well. -- 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]
