WebSafe 3.7github.com
|
|
🏠
Skip to content

Add exponential backoff to the retry algorithm of WebCmdlets#26782

Open
mkht wants to merge 4 commits intoPowerShell:masterfrom
mkht:issue19632-expbackoff-2
Open

Add exponential backoff to the retry algorithm of WebCmdlets#26782
mkht wants to merge 4 commits intoPowerShell:masterfrom
mkht:issue19632-expbackoff-2

Conversation

@mkht
Copy link
Contributor

@mkht mkht commented Feb 11, 2026

PR Summary

Add a new parameter -RetryMode to Invoke-WebRequest and Invoke-RestMethod to add the ability to retry with exponential backoff strategy.

The type of -RetryMode is [WebRequestRetryMode] enum and users can select one from two modes.

  • Fixed: Use fixed retry interval. The interval follows the value of -RetryIntervalSec. This is the default mode.

  • Exponential: Use exponential backoff strategy. The retry interval is expressed as RetryIntervalSec * (2 ^ retryCount).

Note 1:
If we select Exponential, the interval will never exceed 600 seconds. This prevents the interval from becoming excessively long. 600 seconds is used by curl.

Note 2:
This is not a breaking change, since the default mode is Fixed. It does not change the behavior of existing scripts.

PR Context

This PR resolves #19632

PR Checklist

@mkht mkht requested a review from a team as a code owner February 11, 2026 13:16
@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Feb 19, 2026
@microsoft-github-policy-service
Copy link
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review - Needed The PR is being reviewed

1 participant

Comments