Skip to content

Lower severity of handled XCom misses - #73198

Merged
kaxil merged 2 commits into
apache:mainfrom
axelray-dev:fix/73175-xcom-not-found-log-level-latest
Nov 4, 2026
Merged

kaxil merged 2 commits into
apache:mainfrom
axelray-dev:fix/73175-xcom-not-found-log-level-latest

Conversation

@axelray-dev

@axelray-dev axelray-dev commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Lower the severity of handled missing XCom responses in the Task SDK client.

Both XCom lookup paths already return handled fallback responses for HTTP 404: get() returns a None value and get_sequence_item() returns XCOM_NOT_FOUND. Log these expected misses at debug level, like the Connection and Variable not-found branches, so task logs do not report them as errors. Debug rather than warning because LazyXComIterator keeps requesting the next offset until it gets a 404, so every iteration over a mapped upstream ends in one of these misses.

The new tests cover both 404 fallbacks, which had no client-level test before.

closes: #73175


Was generative AI tooling used to co-author this PR?
  • Yes - Codex CLI

Generated-by: Codex CLI following the guidelines

@axelray-dev

Copy link
Copy Markdown
Contributor Author

Reviewed the XCom 404 handling and both new regression cases. VPS validation: the two new warning-level tests pass in an isolated task-SDK harness, and Ruff format/check plus git diff --check pass. The full repository test command was not rerun because the Airflow test plugin requires uv, which is not installed on this VPS. The existing Airflow-required generative-AI disclosure remains in the PR body.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Nov 4, 2026
@robertorobles

Copy link
Copy Markdown

Hi! We’re also affected by #73175 and would love to see this merged.

We run Airflow 3.3.2 in production, and these handled 404s on XCom lookups show up as ERROR in our task logs, which adds noise and makes real failures harder to spot. Since the client already handles the 404 with a fallback response, logging it as a warning seems like the right behavior.

I tested this change in our environment and it works as expected: the misses are now logged at warning level and task behavior is unchanged.

Could a maintainer take a look when there’s a chance? Thanks!

Comment thread task-sdk/src/airflow/sdk/api/client.py Resolved
axelray-dev and others added 2 commits November 4, 2026 20:39
LazyXComIterator reads offsets until the server returns 404, so every
iteration over a mapped upstream ends in a handled miss. Log both XCom
not-found branches at debug, like the Connection and Variable lookups.

Move the new tests to httpx2, use the server's real 404 body, and name
them after the fallback they cover.
@kaxil
kaxil force-pushed the fix/73175-xcom-not-found-log-level-latest branch from b269cfc to bdd61c8 Compare November 4, 2026 20:48
@kaxil kaxil removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Nov 4, 2026

@kaxil kaxil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased onto main and pushed a commit that moves both branches to debug and the tests to httpx2. Thanks @axelray-dev!

@kaxil
kaxil enabled auto-merge (squash) November 4, 2026 21:04
@kaxil kaxil added this to the Airflow 3.4.1 milestone Nov 4, 2026
@kaxil kaxil added the backport-to-v3-4-test Backport to v3-4-test label Nov 4, 2026
@kaxil
kaxil merged commit f05c32e into apache:main Nov 4, 2026
103 checks passed
@boring-cyborg

boring-cyborg Bot commented Nov 4, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Nov 4, 2026
* Lower log level for handled XCom misses

* Log handled XCom misses at debug level

LazyXComIterator reads offsets until the server returns 404, so every
iteration over a mapped upstream ends in a handled miss. Log both XCom
not-found branches at debug, like the Connection and Variable lookups.

Move the new tests to httpx2, use the server's real 404 body, and name
them after the fallback they cover.

---------
(cherry picked from commit f05c32e)

Co-authored-by: AxelRay <raynaldo.axel@gmail.com>
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Nov 4, 2026
* Lower log level for handled XCom misses

* Log handled XCom misses at debug level

LazyXComIterator reads offsets until the server returns 404, so every
iteration over a mapped upstream ends in a handled miss. Log both XCom
not-found branches at debug, like the Connection and Variable lookups.

Move the new tests to httpx2, use the server's real 404 body, and name
them after the fallback they cover.

---------
(cherry picked from commit f05c32e)

Co-authored-by: AxelRay <raynaldo.axel@gmail.com>
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
shahar1 pushed a commit that referenced this pull request Nov 6, 2026
* Lower log level for handled XCom misses

* Log handled XCom misses at debug level

LazyXComIterator reads offsets until the server returns 404, so every
iteration over a mapped upstream ends in a handled miss. Log both XCom
not-found branches at debug, like the Connection and Variable lookups.

Move the new tests to httpx2, use the server's real 404 body, and name
them after the fallback they cover.

---------
(cherry picked from commit f05c32e)

Co-authored-by: AxelRay <raynaldo.axel@gmail.com>
Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xcom_pull logs at ERROR level for an expected "XCom not found" case in Airflow 3.x Task SDK

3 participants