Skip to content

fix: preserve extra link XCom keys across task retries - #71472

Open
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix/preserve-extra-link-xcom-across-retries
Open

fix: preserve extra link XCom keys across task retries#71472
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix/preserve-extra-link-xcom-across-retries

Conversation

@waterWang

Copy link
Copy Markdown

When a task instance transitions to running, the execution API collects every XCom key for that task instance into TIRunContext.xcom_keys_to_clear, and the worker deletes each one. There is no filter — the only exemption is deferral.

This means a retry deletes the _link_* rows written by every previous attempt. An extra link can only ever resolve for the attempt that ran last. This collides with #65661 (try-aware extra-links endpoint), which made the read path attempt-aware while the write path still guarantees only the latest attempt's row exists.

Fix: Filter out XCom keys starting with _link_ (the default xcom_key prefix for BaseOperatorLink) from the xcom_keys_to_clear list. This preserves per-attempt extra link rows across retries, allowing the try-aware endpoint to resolve links for any attempt.

Fixes #71471.

@waterWang waterWang changed the title fix: preserve extra link XCom keys across task retries [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] fix: preserve extra link XCom keys across task retries Aug 11, 2026
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.

Operator extra links from earlier attempts are deleted on retry

1 participant