Struct: retry.AdaptiveMode
Overview
AdaptiveMode provides an experimental retry strategy that expands on the Standard retry strategy, adding client attempt rate limits. The attempt rate limit is initially unrestricted, but becomes restricted when the attempt fails with for a throttle error. When restricted AdaptiveMode may need to sleep before an attempt is made, if too many throttles have been received. AdaptiveMode’s sleep can be canceled with context cancel. Set AdaptiveModeOptions FailOnNoAttemptTokens to change the behavior from sleep, to fail fast.
Eventually unrestricted attempt rate limit will be restored once attempts no longer are failing due to throttle errors.
Implemented Interfaces
types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, retry.IsErrorRetryable, types.MetricsFilter, s3.PresignPost, aws.RetryerV2, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream
Method Summary collapse
-
func (a *AdaptiveMode) GetAttemptToken(ctx context.Context) (func(error) error, error)
GetAttemptToken returns the attempt token that can be used to rate limit attempt calls.
-
func (a *AdaptiveMode) GetInitialToken() (releaseToken func(error) error)
GetInitialToken returns the initial attempt token that can increment the retry token pool if the attempt is successful.
-
func (a *AdaptiveMode) IsErrorRetryable(err error) bool
IsErrorRetryable returns if the failed attempt is retryable.
-
func (a *AdaptiveMode) MaxAttempts() int
MaxAttempts returns the maximum number of attempts that can be made for an attempt before failing.
Method Details
func (a *AdaptiveMode) GetAttemptToken(ctx context.Context) (func(error) error, error)
GetAttemptToken returns the attempt token that can be used to rate limit attempt calls. Will be used by the SDK’s retry package’s Attempt middleware to get an attempt token prior to calling the temp and releasing the attempt token after the attempt has been made.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
// File 'aws/retry/adaptive.go', line 131
|
func (a *AdaptiveMode) GetInitialToken() (releaseToken func(error) error)
GetInitialToken returns the initial attempt token that can increment the retry token pool if the attempt is successful.
Deprecated: This method does not provide a way to block using Context, nor can it return an error. Use RetryerV2, and GetAttemptToken instead. Only present to implement Retryer interface.
123 124 125 |
// File 'aws/retry/adaptive.go', line 123
|
func (a *AdaptiveMode) IsErrorRetryable(err error) bool
IsErrorRetryable returns if the failed attempt is retryable. This check should determine if the error can be retried, or if the error is terminal.
90 91 92 |
// File 'aws/retry/adaptive.go', line 90
|
func (a *AdaptiveMode) MaxAttempts() int
MaxAttempts returns the maximum number of attempts that can be made for an attempt before failing. A value of 0 implies that the attempt should be retried until it succeeds if the errors are retryable.
97 98 99 |
// File 'aws/retry/adaptive.go', line 97
|