Skip to content

Add support for getting/setting the retry attempt number on the context - #3135

Open
BalassaMarton wants to merge 2 commits into
App-vNext:mainfrom
BalassaMarton:context-set-retry-attempt-number
Open

Add support for getting/setting the retry attempt number on the context#3135
BalassaMarton wants to merge 2 commits into
App-vNext:mainfrom
BalassaMarton:context-set-retry-attempt-number

Conversation

@BalassaMarton

Copy link
Copy Markdown

Added RetryResilienceContextExtensions with methods for getting/setting the current retry attempt number.
Changed RetryResilienceStrategy to respect and update this property on the context.
Closes #3095

@BalassaMarton
BalassaMarton marked this pull request as ready for review July 2, 2026 12:14
Comment thread src/Polly.Core/Retry/RetryResilienceContextExtensions.cs
Comment thread src/Polly.Core/Retry/RetryResilienceStrategy.cs Outdated
Comment thread src/Polly.Core/Retry/RetryResilienceStrategy.cs
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.11%. Comparing base (0ce278c) to head (df9d438).
⚠️ Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
...lly.Core/Retry/RetryResilienceContextExtensions.cs 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3135      +/-   ##
==========================================
- Coverage   96.16%   96.11%   -0.05%     
==========================================
  Files         311      309       -2     
  Lines        7139     7106      -33     
  Branches     1006      999       -7     
==========================================
- Hits         6865     6830      -35     
- Misses        221      222       +1     
- Partials       53       54       +1     
Flag Coverage Δ
linux 99.91% <83.33%> (+3.75%) ⬆️
macos 96.11% <83.33%> (-0.05%) ⬇️
windows 99.91% <83.33%> (+3.76%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@BalassaMarton
BalassaMarton force-pushed the context-set-retry-attempt-number branch from c4c65a6 to c1267e6 Compare July 9, 2026 10:45
Comment thread src/Polly.Core/Retry/RetryResilienceContextExtensions.cs Outdated
Co-authored-by: Martin Costello <martin@martincostello.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request]: Allow setting the retry attempt

2 participants