Skip to content

[Feature request]: Allow setting the retry attempt #3095

Description

@BalassaMarton

Is your feature request related to a specific problem? Or an existing feature?

The problem I'm facing is that I'm using a Polly retry strategy for running a retriable action, but in a durable way: I'm storing the number of previous attempts, and the process can exit in the middle of the Nth attempt. When that happens, and execution resumes in a different process, I want to be able to run the same resiliency pipeline, but tell it to start from attempt N so that a recurring error that might crash the process doesn't make the pipeline start from the first attempt every time and go into an infinite retry loop.

Describe the solution you'd like

The cheapest solution would be to add an optional property to RetryStrategyOptions:

    public ResiliencePropertyKey<uint>? CurrentAttemptPropertyKey { get; set; }

When this property is set on the context, RetryResilienceStrategy should read the attempt number from this property instead of initializing it to 0.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions