Ignore stale executor success with per-invocation workload_run_id - #73510
Closed
Pedrinhonitz wants to merge 20 commits into
Closed
Pedrinhonitz wants to merge 20 commits into
Pedrinhonitz wants to merge 20 commits into
Conversation
fix(core): test connection api ui solved apache#72318
fix(ruff): format docstring
fix connection test with null host and port
…cess-with-per-invocation-workload_run_id Ignore stale executor success with per-invocation workload_run_id
Pedrinhonitz
requested review from
XD-DENG,
ashb,
dheerajturaga,
ephraimbuddy,
hussein-awala,
jedcunningham,
jscheffl,
o-nikolas and
pierrejeambrun
as code owners
September 21, 2026 23:20
Pedrinhonitz
marked this pull request as draft
September 22, 2026 11:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the deferred-task race where a stale executor SUCCESS (from the worker that exited on defer) is applied to the resumed attempt that still shares the same TaskInstanceKey (try_number unchanged). Heuristics based on next_method + state (SCHEDULED/QUEUED/RUNNING) keep growing and still miss cases.
This PR introduces a per-invocation workload_run_id (UUID):
Generated on every scheduler enqueue and stored on TaskInstance (+ history / migration).
Carried on executor completion events (event_buffer is now (state, info, workload_run_id)).
In process_executor_events, events whose run id does not match the TI’s current workload_run_id are treated as stale (same idea as requeued) and do not fail the current attempt.
LocalExecutor / Celery / Kubernetes emit and consume the id (with provider-compat fallbacks for older cores).
Cleared with external_executor_id on clear/orphan paths.
Related: #66374 / #66431, #67287 / #68741, #72716 / #71579 / #72767
Was generative AI tooling used to co-author this PR?
Generated-by: Cursor IA IDLE, for discussion and planning of the solution. Following the guidelines