You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/storage-retry-policy-go.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,13 @@ In this article, you learn how to use the Azure Storage client module for Go to
20
20
21
21
Retry policies for Blob Storage are configured programmatically, offering control over how retry options are applied to various service requests and scenarios. For example, a web app issuing requests based on user interaction might implement a policy with fewer retries and shorter delays to increase responsiveness and notify the user when an error occurs. Alternatively, an app or component running batch requests in the background might increase the number of retries and use an exponential backoff strategy to allow the request time to complete successfully.
22
22
23
-
The following table lists the fields available to configure in a [RetryOptions](/java/api/com.azure.storage.common.policy.requestretryoptions) instance, along with the type, a brief description, and the default value if you make no changes. You should be proactive in tuning the values of these properties to meet the needs of your app.
23
+
The following table lists the fields available to configure in a [RetryOptions](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore/policy#RetryOptions) instance, along with the type, a brief description, and the default value if you make no changes. You should be proactive in tuning the values of these properties to meet the needs of your app.
24
24
25
25
| Property | Type | Description | Default value |
26
26
| --- | --- | --- | --- |
27
27
|`MaxRetries`|`int32`| Optional. Specifies the maximum number of attempts a failed operation is retried before producing an error. A value less than zero means one try and no retries. | 3 |
28
-
|`TryTimeout`|`time.Duration`| Optional. Indicates the maximum time allowed for any single try of an HTTP request. Specify a value greater than zero to enable. Note: Setting this to a small value might cause premature HTTP request timeouts. | Disabled by default. |
29
-
|`RetryDelay`|`time.Duration`| Optional. Specifies the initial amount of delay to use before retrying an operation. The value is used only if the HTTP response does not contain a Retry-After header. The delay increases exponentially with each retry up to the maximum specified by MaxRetryDelay. A value less than zero means no delay between retries. | 4 seconds |
28
+
|`TryTimeout`|`time.Duration`| Optional. Indicates the maximum time allowed for any single try of an HTTP request. Specify a value greater than zero to enable. Note: Setting this field to a small value might cause premature HTTP request timeouts. | Disabled by default. |
29
+
|`RetryDelay`|`time.Duration`| Optional. Specifies the initial amount of delay to use before retrying an operation. The value is used only if the HTTP response doesn't contain a Retry-After header. The delay increases exponentially with each retry up to the maximum specified by MaxRetryDelay. A value less than zero means no delay between retries. | 4 seconds |
30
30
|`MaxRetryDelay`|`time.Duration`| Optional. Specifies the maximum delay allowed before retrying an operation. Typically, the value is greater than or equal to the value specified in `RetryDelay`. A value less than zero means there's no maximum. | 60 seconds |
31
31
|`StatusCodes`|[]int | Optional. Specifies the HTTP status codes that indicate the operation should be retried. Specifying values replaces the default values. Specifying an empty slice disables retries for HTTP status codes. | 408 - http.StatusRequestTimeout</br>429 - http.StatusTooManyRequests</br>500 - http.StatusInternalServerError</br>502 - http.StatusBadGateway</br>503 - http.StatusServiceUnavailable</br>504 - http.StatusGatewayTimeout |
32
32
|`ShouldRetry`|`func(*http.Response, error) bool`| Optional. evaluates if the retry policy should retry the request. When specified, the function overrides comparison against the list of HTTP status codes and error checking within the retry policy. `Context` and `NonRetriable` errors remain evaluated before calling `ShouldRetry`. The `*http.Response` and `error` parameters are mutually exclusive, that is, if one is `nil`, the other isn't `nil`. A return value of true means the retry policy should retry. ||
0 commit comments