IvanildoBarauna commented on PR #64198:
URL: https://github.com/apache/airflow/pull/64198#issuecomment-4129071372

   Thanks for the review, @Nataneljpwd!
   
   To clarify the intent of this change: the behavior only changes when the 
`on_retry_callback` raises **`AirflowFailException`** specifically — not when 
it raises any other exception.
   
   The key distinction:
   
   - **Callback raises a generic exception** (e.g. cleanup code fails, partial 
data deletion throws an error) → behavior is **unchanged**: the exception is 
logged and the retry proceeds normally, exactly as today.
   - **Callback raises `AirflowFailException`** → this is an **explicit 
signal** from the user saying *"I have decided this task should not retry"*. 
Before this fix, that signal was silently swallowed and ignored.
   
   `AirflowFailException` already has this semantics when raised from 
`execute()`:
   
   ```python
   class AirflowFailException(AirflowException):
       """Raise when the task should be failed without retrying."""
   ```
   
   So the fix simply makes `on_retry_callback` respect the same contract that 
already exists in task execution.
   
   Regarding `on_success_callback`: that callback runs when the task has 
already succeeded — there is no retry decision to be made at that point, so 
`AirflowFailException` there would have a different (and arguably less clear) 
meaning. This PR stays focused on the retry path where the exception's intent 
is unambiguous.


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