GitHub user rwhitt2049 added a comment to the discussion: Conditional retry on 
callback

I made a slight tweak on the above that will ensure that any 
`on_failure_callback`s still get called. Just setting the instance state 
prevented retries, but any failure callbacks didn't get executed.

```python
def retry_callback(context):
    if True:  # some condition
        ti = context["ti"]
        ti.handle_failure(error=None, force_fail=True).  # this will set the 
state to failed and call the on_failure_callback
```

GitHub link: 
https://github.com/apache/airflow/discussions/28263#discussioncomment-11032021

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to