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

Add retry capability to REST client to handle transient errors #1844

Merged
merged 11 commits into from
Oct 19, 2023

Conversation

Y-Sindo
Copy link
Member

@Y-Sindo Y-Sindo commented Oct 16, 2023

Add retry capability to REST client to handle transient errors. Tracking issue: Azure/azure-functions-signalrservice-extension#293

Add two retry modes:

  1. Fixed delay
  2. Exponential backoff delay (Do we need to add jitter to the delay?)

For message APIs:

Only the situations when HTTP status code > 500 are safe to retry.
For 500 error, runtime returns 500 when timeout, so it's not safe to retry.

For non-message APIs:

The following situations are considered to be transient:

  1. HTTP response status code 5xx or 408(Request timeout).
  2. Request timeout with the timeout length configured as ServiceManagerOptions.HttpClientTimeout

@Y-Sindo Y-Sindo force-pushed the restRetry branch 2 times, most recently from 7ed1fd6 to 25c6143 Compare October 16, 2023 14:46
@Y-Sindo Y-Sindo changed the title Add retry to REST client Add retry capability to REST client to handle transient errors Oct 17, 2023

#nullable enable

public class RetryOptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give the class and RetryMode a more specific naming, e.g. HttpClientRetryOptions?

@Y-Sindo Y-Sindo enabled auto-merge (squash) October 19, 2023 08:44
@Y-Sindo Y-Sindo merged commit f69727c into Azure:dev Oct 19, 2023
5 checks passed
@Y-Sindo Y-Sindo deleted the restRetry branch October 19, 2023 11:22
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.

3 participants