Skip to content

Honor start_delay on pause/unpause for standalone activities#10768

Open
fretz12 wants to merge 2 commits into
fredtzeng/saa-start-delay-desclistfrom
fredtzeng/saa-start-delay-pause
Open

Honor start_delay on pause/unpause for standalone activities#10768
fretz12 wants to merge 2 commits into
fredtzeng/saa-start-delay-desclistfrom
fredtzeng/saa-start-delay-pause

Conversation

@fretz12

@fretz12 fretz12 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@fretz12 fretz12 requested review from a team as code owners June 18, 2026 17:28
@fretz12 fretz12 marked this pull request as draft June 18, 2026 17:30
@fretz12 fretz12 force-pushed the fredtzeng/saa-start-delay-desclist branch from 4748df2 to b1d3d85 Compare June 18, 2026 20:03
@fretz12 fretz12 force-pushed the fredtzeng/saa-start-delay-pause branch from eb8bd4a to c1f8606 Compare June 18, 2026 20:04
@fretz12 fretz12 force-pushed the fredtzeng/saa-start-delay-desclist branch from b1d3d85 to 0e74b39 Compare June 18, 2026 21:23
@fretz12 fretz12 force-pushed the fredtzeng/saa-start-delay-pause branch from d75f595 to 0ce42ee Compare June 18, 2026 21:23
fretz12 added 2 commits June 18, 2026 15:10
Pre-dispatch unpause now lifts the next dispatch to scheduleTime + start_delay
instead of firing at unpause time. A new respectStartDelay helper is shared
across UpdateActivityExecutionOptions, handleReset, and unpause.

Also tightens handleReset's RestoreOriginalOptions block: the start_delay
value restore (and dispatch clamp) now gate on FirstAttemptStartedTime
instead of Status, so retry-backoff resets no longer surface a stale
start_delay value in Describe.
@fretz12 fretz12 force-pushed the fredtzeng/saa-start-delay-desclist branch from 0e74b39 to 7e132e7 Compare June 18, 2026 22:15
@fretz12 fretz12 force-pushed the fredtzeng/saa-start-delay-pause branch from 0ce42ee to 1d632a3 Compare June 18, 2026 22:15
@fretz12 fretz12 marked this pull request as ready for review June 18, 2026 22:57
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.

1 participant