Skip to content

Commit

Permalink
fileservice: use noop retryer in aws sdk (#17096)
Browse files Browse the repository at this point in the history
retry will be done in the fileservice package

Approved by: @zhangxu19830126, @sukki37
  • Loading branch information
reusee authored Jun 24, 2024
1 parent 80cf8cb commit 856539f
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions pkg/fileservice/aws_sdk_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"time"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/transport/http"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
Expand Down Expand Up @@ -111,12 +110,7 @@ func NewAwsSDKv2(
// options for s3 client
s3Options := []func(*s3.Options){
func(opts *s3.Options) {

opts.Retryer = retry.NewStandard(func(o *retry.StandardOptions) {
o.MaxAttempts = maxRetryAttemps
o.RateLimiter = noOpRateLimit{}
})

opts.Retryer = new(aws.NopRetryer)
},
}

Expand Down Expand Up @@ -607,15 +601,6 @@ func (a *AwsSDKv2) mapError(err error, path string) error {
return err
}

// from https://github.com/aws/aws-sdk-go-v2/issues/543
type noOpRateLimit struct{}

func (noOpRateLimit) AddTokens(uint) error { return nil }
func (noOpRateLimit) GetToken(context.Context, uint) (func() error, error) {
return noOpToken, nil
}
func noOpToken() error { return nil }

func (o ObjectStorageArguments) credentialsProviderForAwsSDKv2(
ctx context.Context,
) (
Expand Down

0 comments on commit 856539f

Please sign in to comment.