Retry ambiguous task starts for active worker polls - #11734
Open
ali-khokhar-nvidia wants to merge 3 commits into
Open
Retry ambiguous task starts for active worker polls#11734ali-khokhar-nvidia wants to merge 3 commits into
ali-khokhar-nvidia wants to merge 3 commits into
Conversation
This was referenced Aug 23, 2026
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.
What changed?
RecordWorkflowTaskStartedorRecordActivityTaskStartedrequest, including its request ID, across attempt-local deadlines while the original worker poll remains active.BusyWorkflowinside the same-ID recovery path. History's existing workflow-lock wait paces these attempts while the original operation finishes.An initial
BusyWorkflow, queue redelivery, otherResourceExhaustedcauses, and all definitive errors preserve their existing behavior. A different worker poll still receives a new request ID.Why?
History can commit a task start while Matching observes its shorter child-context deadline before receiving the response. If the original operation is still finishing, the same-ID recovery attempt can first receive
BusyWorkflow. Leaving that recovery path lets a later dispatch create a new request ID; History then returnsTaskAlreadyStarted, and no worker receives the committed start response.The safe recovery boundary is the existing parent worker poll. The
Poll*TaskQueuehandler creates the record-start request once, and the retry closure reuses that request while each attempt context remains a child of the poll context. When that poll context ends, recovery stops. A later poll enters a new handler invocation and creates a new request ID, so the recovered response can return only through the original poll and cannot be transferred to another worker. Fixes #11733.How did you test it?