Preserve Nexus start-to-close timeout after deferred cancellation - #12043
Open
Qian-Cheng-nju wants to merge 1 commit into
Open
Qian-Cheng-nju wants to merge 1 commit into
Qian-Cheng-nju wants to merge 1 commit into
Conversation
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?
When a Nexus operation starts after cancellation was requested, schedule the deferred cancellation transition and then continue the parent operation transition so it also emits the configured start-to-close timeout task.
The state-machine regression test verifies that the transition emits the timeout task. The functional test blocks the Nexus start response, requests cancellation, then verifies both cancellation delivery and the eventual
NEXUS_OPERATION_TIMED_OUThistory event. It pins the legacy HSM implementation that contains this transition.Why?
When cancellation is requested while a Nexus start call is still in flight and that call later returns an asynchronous operation, Temporal can omit the configured start-to-close timeout and leave the operation pending past its deadline.
service/history/hsm/nexusoperations/statemachine_test.goreproduces this transition order and observes that no start-to-close timeout task is emitted, leaving the operation without its configured deadline.The started transition returned immediately after scheduling deferred cancellation, before it emitted the timeout task. Cancellation acknowledgement alone does not complete the operation.
How did you test it?
Commands:
The state-machine regression assertion failed on the base revision with zero timeout tasks. It passes with this change, and the functional scenario passed three consecutive runs.
Potential risks
This adds the normal start-to-close timer to the deferred-cancellation path. Existing task validation rejects the timer if the operation is no longer started when it fires.