huozhanfeng commented on a change in pull request #16768:
URL: https://github.com/apache/airflow/pull/16768#discussion_r663627901
##########
File path: airflow/models/taskinstance.py
##########
@@ -1495,8 +1495,7 @@ def handle_failure(
except Exception:
self.log.exception('Failed to send email to: %s', task.email)
- if not test_mode:
- session.merge(self)
+ session.merge(self)
Review comment:
> But I assume there is a reason it doesn’t save the task instance,
although I do not know what. What would fail if you remove this change?
I think so at the beginning, and I have tried to find the historical git
log, nothing found. The UT always successful if remove this change although the
logic is wrong because the task instance is not committed into DB/session in UT
mode.
--
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]