Skip to content

Commit 0f7460b

Browse files
committed
Update description and use of multiplier and increment properties
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
1 parent 1709567 commit 0f7460b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

roadmap/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ _Status description:_
2525
| --- | --- | --- |
2626
| ✔️| Fix support for workflow extensions | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
2727
| ✔️| Fix state execution timeout | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
28+
| ✔️| Update rules of retries increment and multiplier properties | [spec doc](https://github.com/serverlessworkflow/specification/blob/main/specification.md) |
2829
| ✏️️| Add inline state defs in branches | |
2930
| ✏️️| Update rest function definition | |
3031
| ✏️️| Add "completedBy" functionality | |

specification.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,6 +4227,9 @@ To explain this better, let's say we have the following retry definition:
42274227
which means that we will retry up to 4 times after waiting with increasing delay between attempts;
42284228
in this example 10, 20, 40, and 80 seconds between retries.
42294229

4230+
If both `increment` and `multiplier` properties are defined, `increment` should be applied first and then
4231+
the `multiplier` when determining the next retry time.
4232+
42304233
The `maxAttempts` property determines the maximum number of retry attempts allowed and is a positive integer value.
42314234

42324235
The `jitter` property is important to prevent certain scenarios where clients
@@ -4238,10 +4241,10 @@ reducing total time to complete requests and overall congestion. How this value
42384241
is used in the exponential backoff algorithm is left up to implementations.
42394242

42404243
`jitter` may be specified as a percentage relative to the total delay.
4241-
For example, if `interval` is 2 seconds, `multiplier` is 2 seconds, and we're at
4242-
the third attempt, there will be a delay of 6 seconds. If we set `jitter` to
4243-
0.3, then a random amount of time between 0 and 1.8 (`totalDelay * jitter == 6 * 0.3`)
4244-
will be added or subtracted from the delay.
4244+
Once the next retry attempt delay is calculated, we can apply `jitter` as a percentage value relative to this
4245+
calculated delay. For example, if your calculated delay for the next retry is six seconds, and we specify
4246+
a `jitter` value of 0.3, a random amount of time between 0 and 1.8 (0.3 times 6) is to be added or subtracted
4247+
from the calculated delay.
42454248

42464249
Alternatively, `jitter` may be defined as an absolute value specified as an ISO
42474250
8601 duration. This way, the maximum amount of random time added is fixed and
@@ -4271,8 +4274,6 @@ in this example we might observe the following series of delays:
42714274
* 100s (min(`maxDelay`, (43s * `multiplier`) +/- rand(`jitter`)) => min(100, (43 * 4) + 0))
42724275
* 100s (min(`maxDelay`, (100s * `multiplier`) +/- rand(`jitter`)) => min(100, (100 * 4) - 1))
42734276

4274-
For more information, refer to the [Workflow Error Handling](#Workflow-Error-Handling) sections.
4275-
42764277
##### Transition Definition
42774278

42784279
`Transition` definition can have two types, either `string` or `object`.

0 commit comments

Comments
 (0)