-
Notifications
You must be signed in to change notification settings - Fork 368
Open
Labels
Description
Expected Behavior
When a WorkflowActivity throws an exception and WorkflowTaskOptions with a WorkflowRetryPolicy is passed to CallActivityAsync, the activity should be retried according to the policy (up to axNumberOfAttempts times with exponential backoff).
Actual Behavior
The activity executes only once and is not retried. The retry policy configured via WorkflowRetryPolicy is silently ignored. Downgrading to a previous SDK version restores the expected retry behavior.
Steps to Reproduce the Problem
- Create a workflow activity that always throws:
public class CheckInventoryActivity : WorkflowActivity<MyInput, MyOutput>
{
public override async Task<MyOutput> RunAsync(WorkflowActivityContext
context, MyInput request)
{
Console.WriteLine($"Activity attempt for instance:
{context.InstanceId}");
throw new KeyNotFoundException("Resource not found");
}
}
- Call the activity from a workflow with a retry policy:
var retryPolicy = new WorkflowRetryPolicy(
maxNumberOfAttempts: 5,
firstRetryInterval: TimeSpan.FromSeconds(1),
backoffCoefficient: 2.0,
maxRetryInterval: TimeSpan.FromSeconds(60)
);
var activityOptions = new WorkflowTaskOptions(retryPolicy);
var result = await context.CallActivityAsync<MyOutput>(
nameof(CheckInventoryActivity),
input,
activityOptions
);
- Trigger the workflow and observe logs — the Console.WriteLine only appears once instead of 5 times.
Environment:
- Dapr.Workflow NuGet package version: 1.17.4
- Previous version where retries worked correctly: 1.16.1
Release Note
RELEASE NOTE:
Reactions are currently unavailable