Skip to content

Commit 9d562d0

Browse files
committed
fixup! Run Task failure callbacks on DAG Processor when task is externally killed
1 parent 3ea3c49 commit 9d562d0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

airflow-core/src/airflow/api_fastapi/execution_api/datamodels/taskinstance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class TIRunContext(BaseModel):
301301
dag_run: DagRun
302302
"""DAG run information for the task instance."""
303303

304-
task_reschedule_count: Annotated[int, Field(default=0)]
304+
task_reschedule_count: int = 0
305305
"""How many times the task has been rescheduled."""
306306

307307
max_tries: int

airflow-core/src/airflow/jobs/scheduler_job_runner.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,9 @@ def process_executor_events(
931931
context_from_server=TIRunContext(
932932
dag_run=ti.dag_run,
933933
max_tries=ti.max_tries,
934+
variables=[],
935+
connections=[],
936+
xcom_keys_to_clear=[],
934937
),
935938
)
936939
executor.send_callback(request)
@@ -2290,6 +2293,9 @@ def _purge_task_instances_without_heartbeats(
22902293
context_from_server=TIRunContext(
22912294
dag_run=ti.dag_run,
22922295
max_tries=ti.max_tries,
2296+
variables=[],
2297+
connections=[],
2298+
xcom_keys_to_clear=[],
22932299
),
22942300
)
22952301
session.add(

0 commit comments

Comments
 (0)