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

leaking file descriptors in s3 GetObject #408

Closed
bctsui opened this issue Oct 24, 2015 · 2 comments
Closed

leaking file descriptors in s3 GetObject #408

bctsui opened this issue Oct 24, 2015 · 2 comments
Labels
documentation This is a problem with documentation. feature-request A feature should be added or improved.

Comments

@bctsui
Copy link

bctsui commented Oct 24, 2015

This is how I can reproduce:

  1. Set max file descriptors to N (eg. ulimit -n N).
  2. Make N calls to S3.GetObject() for N different keys that exist.
  3. Make the (N+1)th call to S3.GetObject() for a different object and an error about too many open files will appear.

Are we supposed to free up resources or reuse connections manually? I don't see it anywhere in the docs.

@jasdel
Copy link
Contributor

jasdel commented Oct 24, 2015

Thanks for contacting us @bctsui. Yes you'll need to close the GetObjectOutput.Body io.ReadCloser when your done with it. This body is basically the same as a http.Response.Body and needs to be closed after ever response. Thanks about pointing out the documentation could be better. Tagging this so we can add documentations around this.

@jasdel jasdel added the documentation This is a problem with documentation. label Nov 19, 2015
@jasdel
Copy link
Contributor

jasdel commented Nov 24, 2015

Hi @bctsui I've updated our wiki documentation to include the need to close the body on operation responses with a Body or io.ReadCloser fields.

https://github.com/aws/aws-sdk-go/wiki/making-requests#handling-operation-response-body

@jasdel jasdel closed this as completed Nov 24, 2015
@diehlaws diehlaws added feature-request A feature should be added or improved. and removed enhancement labels Jan 4, 2019
skotambkar added a commit to skotambkar/aws-sdk-go that referenced this issue May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants