ephraimbuddy commented on a change in pull request #17347:
URL: https://github.com/apache/airflow/pull/17347#discussion_r680145422
##########
File path: airflow/models/taskinstance.py
##########
@@ -1343,18 +1343,27 @@ def _run_finished_callback(self, error:
Optional[Union[str, Exception]] = None)
if task.on_failure_callback is not None:
context = self.get_template_context()
context["exception"] = error
- task.on_failure_callback(context)
+ try:
+ task.on_failure_callback(context)
+ except Exception:
+ log.exception("Failed when executing execute
on_failure_callback:")
elif self.state == State.SUCCESS:
task = self.task
if task.on_success_callback is not None:
context = self.get_template_context()
- task.on_success_callback(context)
+ try:
+ task.on_success_callback(context)
+ except Exception:
Review comment:
Nice. I’m suggesting we have a test for this change
--
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]