-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What are you really trying to do?
Setting retry policy to "unlimited".
Describe the bug
In a workflow, call proxyActivities
with the below retry policy object:
const retryPolicy = {
maximumAttempts: 0
}
Minimal Reproduction
Not needed. The code below is at odds with the documentation:
sdk-typescript/packages/common/src/retry-policy.ts
Lines 53 to 63 in 9b3ec22
if (retryPolicy.maximumAttempts != null) { | |
if (retryPolicy.maximumAttempts === Number.POSITIVE_INFINITY) { | |
// drop field (Infinity is the default) | |
const { maximumAttempts: _, ...without } = retryPolicy; | |
retryPolicy = without; | |
} else if (retryPolicy.maximumAttempts <= 0) { | |
throw new ValueError('RetryPolicy.maximumAttempts must be a positive integer'); | |
} else if (!Number.isInteger(retryPolicy.maximumAttempts)) { | |
throw new ValueError('RetryPolicy.maximumAttempts must be an integer'); | |
} | |
} |
It throws when maximumAttempts
is 0.
The documentation states the following:
Setting the [Maximum Attempts] value to 0 also means unlimited.
Environment/Versions
Not needed.
Additional context
The workaround is to set the value to Number.POSITIVE_INFINITY
or undefined
.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working