ferruzzi commented on code in PR #68961: URL: https://github.com/apache/airflow/pull/68961#discussion_r3531584776
########## airflow-core/docs/howto/deadline-alerts.rst: ########## @@ -44,6 +44,7 @@ Creating a Deadline Alert requires three mandatory parameters: * Reference: When to start counting from * Interval: How far before or after the reference point to trigger the alert (either a timedelta or a dynamic interval such as VariableInterval) * Callback: A Callback object which contains a path to a callable and optional kwargs to pass to it if the deadline is exceeded +* Fire on failure: Optional. If set to ``True``, a pending Dag run deadline alert fires immediately when the scheduler marks the Dag run failed. Manual UI/API mark-failed paths are unchanged. The default is ``False``. Review Comment: I feel like this is the correct answer for cases 1 and 3 from above, and Ramit's `skip_on_failure` would be the solution for case 2: `fire_on_failure=False` covers case 1 from above: A user sees the Dag failed and re-triggers it; the user doesn't want that deadline alert to go out until they can't possibly recover. `fire_on_failure=True` covers case 3 from above: If the Dag has failed and can not recover then it will inevitably miss the deadline, the user may want that advanced notice, which is what this PR allows. `skip_on_failure` covers case 2 from above: If the Dag has an `on_failure_callback` and the user decides that they don't need the deadline callback if that one goes off, then that would be where Ramit's `skip_on_failure` comes in. I don't see them as mutually exclusive and I feel like shivaam can implement `skip_on_failure` in a follow-up. -- 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]
