Azure / Azure/azure-functions-durable-js
RetryOptions with retryTimeoutInMilliseconds exceeded stops orchestration
- Dominant language
- TypeScript
- Stars
- 142
- Forks
- 66
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 4
Description
**Describe the bug**
When calling an activity with `RetryOptions`, if the maximum allowed amount of time spent retrying is exceeded, the orchestration stops. No exception is thrown that can be caught.
**Investigative information**
- Durable Functions extension version: Extension Bundle [4.0.0, 5.0.0)
- durable-functions npm module version: 3.1.0
- Language (JavaScript/TypeScript) and version: JavaScript
- Node.js version: v21.7.3
**To Reproduce**
Activity code:
```js
const df = require('durable-functions');
const handler = async (input, context) => {
await new Promise((resolve) => setTimeout(resolve, 3000));
throw new Error('Simulated error after some time');
};
df.app.activity('activity', {
handler
});
```
Orchestration code:
```js
const df = require('durable-functions');
const retryOptions = new df.RetryOptions(1_500, 4);
retryOptions.retryTimeoutInMilliseconds = 10_000;
const handler = function* (context) {
try {
yield context.df.callActivityWithRetry('activity', retryOptions);
context.info('Activity succeeded');
} catch (e) {
context.info('Activity failed');
} finally {
context.info('Done');
}
};
df.app.orchestration('orchestration', handler);
```
Nothing will be logged when running this orchestration: the code doesn't reach the `context.info('Activity succeeded');` statement, nor is an exception thrown.
**Expected behavior**
An exception should be thrown.
**Actual behavior**
No exception thrown, no value yielded from the `callActivityWithRetry`. Basically the orchestration is 'stuck' (but it's still in a _Running_ state when queried through the instance API).
Contributor guide
Research direction
Start with the reproduced activity and orchestration handlers, especially RetryOptions.retryTimeoutInMilliseconds and callActivityWithRetry. Run the example with the listed Durable Functions and Node.js versions, then trace the orchestration through the instance API when the retry timeout is exceeded. Done means the failure reaches the catch block, the finally block logs, and the instance does not remain stuck in Running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, javascript, node.js
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100