uranusjr commented on code in PR #34619:
URL: https://github.com/apache/airflow/pull/34619#discussion_r1338121912
##########
airflow/models/dag.py:
##########
@@ -2828,7 +2842,15 @@ def add_logger_if_needed(ti: TaskInstance):
try:
add_logger_if_needed(ti)
ti.task = tasks[ti.task_id]
- _run_task(ti, session=session)
+ ret = _run_task(ti, session=session)
+ if ret is TaskReturnCode.DEFERRED:
+ if not _triggerer_is_healthy():
+ raise _StopDagTest(
+ "Task has deferred but triggerer component is
not running. "
+ "You can start the triggerer by running
`airflow triggerer` in a terminal."
+ )
+ except _StopDagTest:
+ raise
Review Comment:
```suggestion
except _StopDagTest:
# Let this bubble out and not be swallowed by the
# except block below.
raise
```
##########
airflow/models/dag.py:
##########
@@ -2828,7 +2842,15 @@ def add_logger_if_needed(ti: TaskInstance):
try:
add_logger_if_needed(ti)
ti.task = tasks[ti.task_id]
- _run_task(ti, session=session)
+ ret = _run_task(ti, session=session)
+ if ret is TaskReturnCode.DEFERRED:
+ if not _triggerer_is_healthy():
+ raise _StopDagTest(
+ "Task has deferred but triggerer component is
not running. "
+ "You can start the triggerer by running
`airflow triggerer` in a terminal."
+ )
+ except _StopDagTest:
+ raise
Review Comment:
```suggestion
except _StopDagTest:
# Let this exception bubble out and not be swallowed by
the
# except block below.
raise
```
--
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]