Skip to content
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

Support retrying S3 connection resets on GetObject body #1242

Closed
hallmaxw opened this issue May 2, 2017 · 7 comments
Closed

Support retrying S3 connection resets on GetObject body #1242

hallmaxw opened this issue May 2, 2017 · 7 comments
Labels
feature-request A feature should be added or improved.

Comments

@hallmaxw
Copy link

hallmaxw commented May 2, 2017

Version of AWS SDK for Go?

1.8.19 (latest version)

Version of Go (go version)?

1.8

What issue did you see?

Connection reset by peer when reading the body of a s3.GetObjectOutput. I'd expect the SDK to be capable of retrying connection resets.

The problem is the REST unmarshal handler just sets GetObjectOutput.Body's to HTTPResponse.Body without reading the data. Request.Send() will then return successfully, but an error may still occur when the caller tries to read GetObjectOutput.Body. This error occurs outside of the AWS SDK's logic. Therefore, consumers can't take advantage of Request's retry logic.

Steps to reproduce

I don't have a code snippet, but this is easily reproducible if you put a decent load on an S3 bucket. It's common for S3 to reset the connection while reading the GetObjectOutput.Body body. See AWS support's response to this thread https://forums.aws.amazon.com/thread.jspa?threadID=111195.

@xibz xibz added bug This issue is a bug. feature-request A feature should be added or improved. and removed bug This issue is a bug. labels May 2, 2017
@xibz
Copy link
Contributor

xibz commented May 2, 2017

Hello @mbh621, thank you for reaching out to us. I would suggest using the s3manager package. This will retry on connection resets. Please let us know if you have any issues there. Meanwhile I'll make this as a feature request for the service/s3 package.

@jasdel
Copy link
Contributor

jasdel commented May 12, 2017

One way i think the SDK could implement this functionality is to add support for an intermediate reader that would keep track of the bytes read by the user. When a error occurs internally it could do another GetObject request, but using byte range to start where it had left off. I imagine that the retry could would be configurable.

I think this would be the best strategy for implementing this feature.

@alex
Copy link
Contributor

alex commented Nov 19, 2019

@xibz (Several year late to this, my apologies!) one of the downsides of s3manager is that it has a significantly different API, since you give it an io.Write which it writes to, rather than returning an io.Read.

If s3manager offered an API that gave you an io.Read, I think it'd be drop-in enough that you could close this in favor of telling people to always use s3manager. (If you'd be prefer that be treated as a separate feature request, please let me know and I'll file another issue)

@github-actions
Copy link

We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Nov 19, 2020
@alex
Copy link
Contributor

alex commented Nov 19, 2020

I don't think anything has changed that obviates or resolves this issue.

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Nov 20, 2020
mattnibs added a commit to brimdata/super that referenced this issue Feb 10, 2021
If a "connection error" reset is encountered while reading a s3 object attempt
to restart the connection and resume read at the current offset.

This solves a bug found when trying to ingest several s3 hosted log files:
several files will stop ingesting with the error "connection reset by peer".
There seems to be a curious behavior of the s3 service that happens when
a single session maintains numerous long-running download connections to
various objects in a bucket- the service appears to reset connections at
random.

See: aws/aws-sdk-go#1242

Closes #2005
mattnibs added a commit to brimdata/super that referenced this issue Feb 10, 2021
If a "connection error" reset is encountered while reading a s3 object attempt
to restart the connection and resume read at the current offset.

This solves a bug found when trying to ingest several s3 hosted log files:
several files will stop ingesting with the error "connection reset by peer".
There seems to be a curious behavior of the s3 service that happens when
a single session maintains numerous long-running download connections to
various objects in a bucket- the service appears to reset connections at
random.

See: aws/aws-sdk-go#1242

Closes #2005
mattnibs added a commit to brimdata/super that referenced this issue Feb 10, 2021
If a "connection error" reset is encountered while reading a s3 object attempt
to restart the connection and resume read at the current offset.

This solves a bug found when trying to ingest several s3 hosted log files:
several files will stop ingesting with the error "connection reset by peer".
There seems to be a curious behavior of the s3 service that happens when
a single session maintains numerous long-running download connections to
various objects in a bucket- the service appears to reset connections at
random.

See: aws/aws-sdk-go#1242

Closes #2005
mattnibs added a commit to brimdata/super that referenced this issue Feb 11, 2021
If a "connection error" reset is encountered while reading a s3 object attempt
to restart the connection and resume read at the current offset.

This solves a bug found when trying to ingest several s3 hosted log files:
several files will stop ingesting with the error "connection reset by peer".
There seems to be a curious behavior of the s3 service that happens when
a single session maintains numerous long-running download connections to
various objects in a bucket- the service appears to reset connections at
random.

See: aws/aws-sdk-go#1242

Closes #2005
@jasdel jasdel changed the title Support retrying S3 connection resets Support retrying S3 connection resets on GetObject body Mar 2, 2021
@skmcgrail
Copy link
Member

Closing this issue, per the messaging here we do not intend to add support for automatically retrying connection reset errors when reading response bodies. Further details can be found in this issue thread: #2926 (comment)

We would be welcome to contributions that add an configurable mechanism to the retryer implementation that allows customers to override this particular behavior, that they could then opt-in to.

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

5 participants