-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
service/s3/s3manager: Add retry download object part body #843
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple comments
err := req.Send() | ||
retry := 0 | ||
var n int64 | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for retry := 0; retry < d.partBodyMaxRetries; retry++ {
}
if err != nil { | ||
d.setErr(err) | ||
retry++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the logic moved into the for expression, perhaps breaking early makes sense?
if err == nil {
break
}
break | ||
} | ||
|
||
d.incrWritten(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then here upon for exit
return err
retry++ | ||
|
||
// Attempt to retry failed chunk retries | ||
if retry > d.partBodyMaxRetries { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can get rid of this if block
Adds the ability to automatically retried S3 object parts that fail after the initial request response is provided. This includes scenarios such as the network connection is terminated, or broken. The body parts will be retried based on the S3 service clients Max Retries configuration. For example setting the aws.Config.MaxRetries to 3 will allow the S3 Downloader to retry part body failures up to 3 times. This feature is enabled automatically. No additional work is needed to take advantage of it. Fix aws#466
7412341
to
0c5b1b9
Compare
Updated to switch to for loop to include retry in statement. |
Adds the ability to automatically retried S3 object parts that fail
after the initial request response is provided. This includes scenarios
such as the network connection is terminated, or broken.
The body parts will be retried based on the S3 service clients Max
Retries configuration. For example setting the aws.Config.MaxRetries to
3 will allow the S3 Downloader to retry part body failures up to 3
times.
This feature is enabled automatically. No additional work is needed to
take advantage of it.
Fix #466