Repository navigation
Fix ignore stale executor success with per invocation workload run - #73546
Draft
Pedrinhonitz wants to merge 17 commits into
Draft
Pedrinhonitz wants to merge 17 commits into
Pedrinhonitz wants to merge 17 commits into
Conversation
Pedrinhonitz
requested review from
XD-DENG,
ashb,
dheerajturaga,
ephraimbuddy,
hussein-awala,
jedcunningham,
jscheffl,
o-nikolas and
pierrejeambrun
as code owners
September 22, 2026 12:25
… from older BaseExecutor
Pedrinhonitz
force-pushed
the
fix/ignore-stale-executor-success-with-per-invocation-workload_run_id
branch
from
September 23, 2026 22:26
940d3dc to
15a4801
Compare
…nvocation-workload_run_id
…nvocation-workload_run_id
…nvocation-workload_run_id
Pedrinhonitz
marked this pull request as draft
September 27, 2026 23:40
…utor-success-with-per-invocation-workload_run_id
This branch has not been deployed
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