Skip to content

Commit 9f84207

Browse files
docs: clarify timeout retry deadline reset behavior
1 parent e3d9b5e commit 9f84207

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/features/timeouts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,19 @@ $result = activity(
134134

135135
### Schedule-to-start timeout
136136

137-
The deadline is computed when the activity is scheduled. If no worker claims the activity before the deadline, the `TaskWatchdog` enforces the timeout. If retry attempts remain, a new activity task is scheduled with the snapped backoff; otherwise a terminal `ActivityTimedOut` history event is recorded and the workflow is woken.
137+
The deadline is computed when the activity is scheduled. If no worker claims the activity before the deadline, the `TaskWatchdog` enforces the timeout. If retry attempts remain, a new activity task is scheduled with the snapped backoff and the schedule-to-start deadline is recomputed relative to the retry's available-at time — each retry gets a fresh window. If no `scheduleToStartTimeout` was configured, the deadline is cleared on retry. If all attempts are exhausted, a terminal `ActivityTimedOut` history event is recorded and the workflow is woken.
138138

139139
### Start-to-close timeout
140140

141-
The deadline is computed when a worker claims the activity task. Each retry gets a fresh deadline. If the activity does not complete before the deadline, the current attempt is closed and the same retry-or-terminal decision applies.
141+
The deadline is computed when a worker claims the activity task. Each retry gets a fresh start-to-close deadline. If the activity does not complete before the deadline, the current attempt is closed. If retry attempts remain, the execution returns to `Pending` with a reset schedule-to-start deadline (if configured) so the retried task is not immediately re-timed-out. If all attempts are exhausted, a terminal timeout is recorded.
142142

143143
### Schedule-to-close timeout
144144

145145
The deadline is computed once at scheduling time and never resets. When it expires, the activity is immediately failed as terminal — even if retry attempts remain, because the total allowed wall-clock time has passed. This is useful for bounding the overall cost of a flaky activity that might otherwise retry indefinitely within its per-attempt limits.
146146

147147
### Heartbeat timeout
148148

149-
The initial deadline is computed when a worker claims the activity task. Each successful `$this->heartbeat()` call extends the deadline by the configured interval. If the activity does not call `heartbeat()` before the deadline expires, the engine assumes the worker is unresponsive. If retry attempts remain, a new attempt is scheduled; otherwise a terminal timeout is recorded.
149+
The initial deadline is computed when a worker claims the activity task. Each successful `$this->heartbeat()` call extends the deadline by the configured interval. If the activity does not call `heartbeat()` before the deadline expires, the engine assumes the worker is unresponsive. If retry attempts remain, a new attempt is scheduled with a reset schedule-to-start deadline (if configured); otherwise a terminal timeout is recorded.
150150

151151
```php
152152
use Workflow\V2\Activity;

0 commit comments

Comments
 (0)