aws / aws-dax-go

AWS DAX SDK for the Go programming language. https://aws.amazon.com/dynamodb/dax
Apache License 2.0
47 stars 48 forks source link

Make retry config honor aws.UseServiceDefaultRetries value #26

Closed kevioke closed 3 years ago

kevioke commented 4 years ago

Issue #, if available: https://github.com/aws/aws-dax-go/issues/25

Description of changes: As mentioned in https://github.com/aws/aws-dax-go/issues/25, the dax library should set reasonable retry defaults when it sees a value of const UseServiceDefaultRetries = -1 which is part of the default aws config. This change adds an additional check for this constant before setting the ReadRetries and WriteRetries values.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

ktseytlin commented 3 years ago

Looks good. Can you add a unit test? Something like: "if set MaxRetries to -1 then the config retry config is set to default value greater than 0 (or equal to X)".

kevioke commented 3 years ago

Looks good. Can you add a unit test? Something like: "if set MaxRetries to -1 then the config retry config is set to default value greater than 0 (or equal to X)".

Thanks a great idea! Added a few tests as well.

kevioke commented 3 years ago

Hi @ktseytlin was wondering if you could take a second look at this PR.

mkadin commented 3 years ago

Please take a look at this PR! We just lost about 16 hours of developer time to this bug :)

kevinchristen commented 3 years ago

Merged, along with a version bump. Thanks for your help.