Skip to content

Read current task executions by exact region and try - #74350

Merged
ashb merged 1 commit into
task-loops-stack-8from
task-loops-stack-9
Oct 10, 2026
Merged

ashb merged 1 commit into
task-loops-stack-8from
task-loops-stack-9

Conversation

@ashb

@ashb ashb commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

A loop pass or a mapped expansion reuses a task id and map index, so reading
a task instance, its XCom, logs, links, HITL detail or state by (task_id,
map_index) no longer names one execution. The public readers take region_id and
region_index and resolve them against the live producers. An index without a
region is rejected because an index means nothing without the region it indexes.
Responses return the region coordinates and a map_index derived from the pinned
definition, so mapped tasks keep presenting their slot as before while a task
inside a loop presents -1. Filters and sorts use the same derived value so
paging and cursors agree with what the responses show.

Retired attempts stay in task_instance under their own UUID, so try details,
logs and external log links select one by try_number plus the same coordinates.
The external log URL used to ignore the try number, which became ambiguous once
several rows share a coordinate. Operator extra links read their XCom from the
selected region and pinned definition, since the coordinates alone no longer say
which execution produced it.

The run-level execution listing returns the region ancestry beside each live
task instance because its coordinates cannot be interpreted without it. The
Gantt payload carries the attempt id and region coordinates so a bar identifies
one attempt.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/log.py
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py Outdated
Comment thread airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_hitl.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/services/public/task_coordinates.py Outdated
Comment thread airflow-core/src/airflow/models/xcom.py Outdated
Comment thread airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_xcom.py Outdated
@ashb
ashb force-pushed the task-loops-stack-9 branch from ddcfe38 to 7436a05 Compare October 7, 2026 13:57
@ashb
ashb removed this pull request from stack #74339 October 7, 2026 15:20
@ashb
ashb force-pushed the task-loops-stack-9 branch from 7436a05 to 1627be4 Compare October 7, 2026 15:22
@ashb
ashb added this pull request to stack #74410 October 7, 2026 15:22
@ashb
ashb force-pushed the task-loops-stack-9 branch 2 times, most recently from 05e212f to d91ebda Compare October 7, 2026 20:57
@ashb
ashb force-pushed the task-loops-stack-9 branch from d91ebda to 32bb9da Compare October 8, 2026 13:56
@ashb
ashb force-pushed the task-loops-stack-9 branch from 32bb9da to f34b417 Compare October 8, 2026 16:06
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_instances.py Outdated
Comment thread airflow-core/src/airflow/api_fastapi/common/parameters/misc.py
@ashb
ashb force-pushed the task-loops-stack-9 branch from f34b417 to 5e14006 Compare October 8, 2026 20:45
@ashb
ashb force-pushed the task-loops-stack-9 branch 2 times, most recently from 83bd2e6 to d5f852b Compare October 9, 2026 14:03
A loop pass or a mapped expansion reuses a task id and map index, so reading
a task instance, its XCom, logs, links, HITL detail or state by (task_id,
map_index) no longer names one execution. The public readers take region_id and
region_index and resolve them against the live producers. An index without a
region is rejected because an index means nothing without the region it indexes.
Responses return the region coordinates and a map_index derived from the pinned
definition, so mapped tasks keep presenting their slot as before while a task
inside a loop presents -1. Filters and sorts use the same derived value so
paging and cursors agree with what the responses show.

Retired attempts stay in task_instance under their own UUID, so try details,
logs and external log links select one by try_number plus the same coordinates.
The external log URL used to ignore the try number, which became ambiguous once
several rows share a coordinate. Operator extra links read their XCom from the
selected region and pinned definition, since the coordinates alone no longer say
which execution produced it.

The run-level execution listing returns the region ancestry beside each live
task instance because its coordinates cannot be interpreted without it. The
Gantt payload carries the attempt id and region coordinates so a bar identifies
one attempt.
@ashb
ashb force-pushed the task-loops-stack-9 branch from 15a150c to 28d3dc6 Compare October 10, 2026 18:24
@ashb
ashb merged commit 0226554 into main Oct 10, 2026
336 of 349 checks passed
@ashb
ashb deleted the task-loops-stack-9 branch October 10, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants