Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity's context's retryContext property is null when activity is being retried #598

Open
guy-weavix opened this issue Apr 8, 2024 · 1 comment
Labels
P2 Priority 2 item

Comments

@guy-weavix
Copy link

Describe the bug
When an orchestrator calls callActivityWithRetry with retry options, I would expect that the retryContext in the instance of InvocationContext passed into the activity's handler would not be null.

df.app.orchestration('TestOrchestrator', function* (context: OrchestrationContext) {
    context.log(`TestOrchestrator started`);

    const retryOptions = new df.RetryOptions(1_000, 3);
    context.log(JSON.stringify(retryOptions));
    const result = (yield context.df.callActivityWithRetry('TestActivity', retryOptions, ''));
    context.log(context, `TestOrchestrator completed`);
    return result;
});

df.app.activity('TestActivity', {
    handler: (text: string, context: InvocationContext): TestResult => {
        context.log(`Started activity with retryCount: ${context.retryContext?.retryCount}/${context.retryContext?.maxRetryCount}`);
        context.log(JSON.stringify(context));

        throw new Error(`boom`);
    },
});

When I run the orchestrator, I see the activity run 3 times as expected, but the retryContext is not present on the context passed into the activity.

Investigative information

  • durable-functions npm module version: 3.1.0
  • Language (JavaScript/TypeScript) and version: Typescript 4.0.0
  • Node.js version: 18.0

To Reproduce
Steps to reproduce the behavior:

Code above is a partial example.

A repo with full code example may be found here

Expected behavior
I would expect that the retryContext on the instance of InvocationContext passed into the activity would not be null and would be populated with the current retry context.

Actual behavior
The instance of the InvocationContext being passed into the activity has no retryContext even though the activity is being retried.

@riteshbxr
Copy link

Can someone help me with status of this task? @bachuv @nytian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Priority 2 item
Projects
None yet
Development

No branches or pull requests

4 participants