kaxil commented on code in PR #65440:
URL: https://github.com/apache/airflow/pull/65440#discussion_r3740862096
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/xcoms.py:
##########
@@ -442,5 +442,4 @@ def delete_xcom(
XComModel.map_index == map_index,
)
session.execute(query)
Review Comment:
Thanks for the PR, and sorry it sat unreviewed for so long.
This exact removal has already landed on `main`: PR `#69495` ("Remove
redundant `session.commit()` calls in FastAPI route handlers", merged
2026-07-07, commit `5e23c6a0cc8d5d3ca9d329b7b3e4c3c87deee2e1`) dropped the same
`session.commit()` from `delete_xcom`, along with three other handlers in
`core_api/routes/public/backfills.py`, `core_api/routes/public/hitl.py`, and
`execution_api/routes/hitl.py`.
I compared this branch's `delete_xcom` against the current
`apache/airflow@main` and the two are byte-identical, so merging this would be
an empty change. I'd suggest closing it.
For what it's worth, the reasoning in your description is right:
`SessionDep` is `Depends(_get_session, scope="function")`, `_get_session` wraps
`create_session(scoped=False)` which commits on clean exit, and
`scope="function"` means that teardown runs before the response is sent — so
the delete is durable before the worker gets its 200. The handler-level commit
was genuinely redundant.
--
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]