Keep local activity scheduleToClose deadline across replay - #3107
Open
sangkyoonnam wants to merge 1 commit into
Open
sangkyoonnam wants to merge 1 commit into
sangkyoonnam wants to merge 1 commit into
Conversation
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.
What was changed
LocalActivityFailedExceptionnow keeps theoriginalScheduledTimestampit is built with, and the timer-backed retry inSyncWorkflowContextpasses that marker value to the next attempt instead of theSystem.currentTimeMillis()captured when workflow code ran. When the marker has no metadata (-1) or nofirstSkd(0), it falls back to the captured value as before.Why?
On replay, the captured value is the replay clock, so each replay restarted the
ScheduleToCloseTimeoutbudget and a failing local activity could keep retrying untilMaximumAttempts. sdk-core and sdk-go both keep the original schedule time across replay. Details and a reproduction in #3106.No SdkFlag: the recorded markers and backoffs still drive replay, and the change only affects the deadline the local activity worker computes for a live attempt.
Checklist
Closes Local activity scheduleToClose budget restarts when a timer-backed retry runs on replay #3106
How was this tested:
LocalActivityScheduleToCloseAcrossReplayTestforces a full-history replay on every workflow task (setStickyQueueScheduleToStartTimeout(Duration.ZERO)) and asserts that every local activity marker carries the first attempt'sfirstSkd, plusRETRY_STATE_TIMEOUTbeforeMaximumAttempts. Without the fix each marker carries a newfirstSkdand the run ends atRETRY_STATE_MAXIMUM_ATTEMPTS_REACHED.io.temporal.workflow.activityTestspasses (117 tests).Any docs updates needed?
No.