Expose requested_start_time and actual_start_time on standalone activities#10760
Merged
fretz12 merged 3 commits intoJun 30, 2026
Merged
Conversation
5 tasks
d1ba240 to
41170f2
Compare
4748df2 to
b1d3d85
Compare
41170f2 to
1d2c473
Compare
b1d3d85 to
0e74b39
Compare
1d2c473 to
4d444ae
Compare
0e74b39 to
7e132e7
Compare
fretz12
commented
Jun 18, 2026
| } else { | ||
| // Deduction failed as there's not enough information to fill in missing timeouts. | ||
| return serviceerror.NewInvalidArgumentf("a valid StartToClose or ScheduleToCloseTimeout is not set on ScheduleActivityTaskCommand. ActivityId=%s ActivityType=%s", | ||
| return serviceerror.NewInvalidArgumentf("a valid StartToCloseTimeout or ScheduleToCloseTimeout must be set on the activity. ActivityId=%s ActivityType=%s", |
Contributor
Author
There was a problem hiding this comment.
sliding in an err message fix as pointed out in another conversation
## What changed? Pre-dispatch unpause for standalone activities now lifts the next dispatch to `scheduleTime + start_delay` instead of firing at unpause time, by wiring the existing `respectStartDelay` helper into the `unpause` path (one line). This means: - Pause then unpause within the delay window → still dispatches at the original wall-clock target. Multiple cycles do not drift it. - Pause past the delay end + unpause → dispatches immediately (no extra delay re-imposed). - Pause after first dispatch + worker yield + unpause → `start_delay` is not re-applied (no-op once the activity has been picked up). - `ScheduleToStartTimeout` re-emitted on unpause is anchored to the new dispatch target, not to "now." `ScheduleToClose` behavior during pause is intentionally unchanged: the deadline stays active and can fire while paused, matching the existing `ScheduleToCloseTimeoutWhilePaused` test. Also annotates the time-constants across the `TestStartDelay` subtests with the math/intent behind each. ## Why? The `start_delay` countdown is wall-clock and keeps ticking through pause; on unpause the activity should dispatch at the original `scheduleTime + start_delay` (or immediately if that target is already past). Before this change, unpause in the delay window dispatched at "now," so a user could accidentally shrink the delay by pausing and unpausing. ## How did you test it? - [X] built - [X] run locally and tested manually - [X] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) --------- Co-authored-by: Dan Davison <dan.davison@temporal.io>
efa05c3
into
fredtzeng/saa-start-delay-reset
43 of 45 checks passed
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?
Adds
requested_start_timeandactual_start_timetoActivityExecutionInfofor standalone activities:requested_start_time=schedule_time + start_delay. Always populated (equalsschedule_timewhenstart_delayis unset).actual_start_time= when a worker first picked up the activity, read fromfirst_attempt_started_time. Unset until first pickup, and never moves on retries or resets.The delta between the two is a useful debugging signal: it captures how long a worker took to pick the activity up after its requested target (matching backlog, worker downtime, etc.).
Also cleaned up a misleading timeout error message.
Why?
Both fields to be exposed via Describe for the SAA "delayed-not-yet-dispatched" use case. Describe today shows neither. This PR closes the Describe-side gap.
How did you test it?