yuseok89 commented on code in PR #74567:
URL: https://github.com/apache/airflow/pull/74567#discussion_r4244823188
##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -3266,7 +3266,20 @@ def _schedule_dag_run(
default=None,
)
for task_instance in unfinished_task_instances:
- task_instance.set_state(TaskInstanceState.SKIPPED,
session=session)
+ if task_instance.state in (
+ TaskInstanceState.RUNNING,
+ TaskInstanceState.DEFERRED,
+ TaskInstanceState.UP_FOR_RESCHEDULE,
+ TaskInstanceState.AWAITING_INPUT,
+ ):
+ # The timeout interrupted a running task instance; mark it
FAILED so a
+ # mapped task with unfinished inner tasks reflects the
failure instead
+ # of appearing successful.
+ task_instance.set_state(TaskInstanceState.FAILED,
session=session)
+ elif not dag.task_dict[task_instance.task_id].is_teardown:
+ # Task instances that never started stay SKIPPED.
Teardowns are left
+ # alone so they can still run.
+ task_instance.set_state(TaskInstanceState.SKIPPED,
session=session)
Review Comment:
It looks like this teardown won't run. The run is already set to FAILED
above, and the scheduler only looks at running runs, so a pending teardown
would stay `None` or `scheduled` in a finished run. A running teardown would
also be set to FAILED by the first branch.
--
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]