Skip to content

Keep local activity scheduleToClose deadline across replay - #3107

Open
sangkyoonnam wants to merge 1 commit into
temporalio:mainfrom
sangkyoonnam:fix/la-schedule-to-close-replay
Open

sangkyoonnam wants to merge 1 commit into
temporalio:mainfrom
sangkyoonnam:fix/la-schedule-to-close-replay

Conversation

@sangkyoonnam

Copy link
Copy Markdown
Contributor

What was changed

LocalActivityFailedException now keeps the originalScheduledTimestamp it is built with, and the timer-backed retry in SyncWorkflowContext passes that marker value to the next attempt instead of the System.currentTimeMillis() captured when workflow code ran. When the marker has no metadata (-1) or no firstSkd (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 ScheduleToCloseTimeout budget and a failing local activity could keep retrying until MaximumAttempts. 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

  1. Closes Local activity scheduleToClose budget restarts when a timer-backed retry runs on replay #3106

  2. How was this tested:
    LocalActivityScheduleToCloseAcrossReplayTest forces a full-history replay on every workflow task (setStickyQueueScheduleToStartTimeout(Duration.ZERO)) and asserts that every local activity marker carries the first attempt's firstSkd, plus RETRY_STATE_TIMEOUT before MaximumAttempts. Without the fix each marker carries a new firstSkd and the run ends at RETRY_STATE_MAXIMUM_ATTEMPTS_REACHED. io.temporal.workflow.activityTests passes (117 tests).

  3. Any docs updates needed?
    No.

@sangkyoonnam
sangkyoonnam requested a review from a team as a code owner October 1, 2026 09:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local activity scheduleToClose budget restarts when a timer-backed retry runs on replay

1 participant