uranusjr commented on code in PR #54972:
URL: https://github.com/apache/airflow/pull/54972#discussion_r2303315567
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -881,11 +881,14 @@ def process_executor_events(
# Get task from the Serialized DAG
try:
dag =
scheduler_dag_bag.get_dag_for_run(dag_run=ti.dag_run, session=session)
- cls.logger().error(
- "DAG '%s' for task instance %s not found in
serialized_dag table",
- ti.dag_id,
- ti,
- )
+ if not dag:
+ cls.logger().error(
+ "DAG '%s' for task instance %s not found in
serialized_dag table",
+ ti.dag_id,
+ ti,
+ )
+ ti.set_state(TaskInstanceState.FAILED, session=session)
+ continue
if TYPE_CHECKING:
assert dag
Review Comment:
This can be removed if we check `if not dag` above.
--
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]