Skip to content

Conversation

@nikolas
Copy link
Member

@nikolas nikolas commented May 7, 2020

Hound sometimes gives errors like these when it's backed up:

http: Accept error: accept tcp [::]:9999: accept4: too many open files;

I think this can be avoided with the changes here. It's best practice to
close the http.Get() response, and also to use a new instance of
http.Client instead of the http.DefaultClient singleton (used by calls
to http.Get()).

I've given the new http.Client a 2-second timeout, which should be fine,
but we can adjust as needed.

Hound sometimes gives errors like these when it's backed up:

    http: Accept error: accept tcp [::]:9999: accept4: too many open files;

I think this can be avoided with the changes here. It's best practice to
close the http.Get() response, and also to use a new instance of
http.Client instead of the http.DefaultClient singleton (used by calls
to http.Get()).

I've given the new http.Client a 2-second timeout, which should be fine,
but we can adjust as needed.

* https://stackoverflow.com/a/48342086/173630
* https://golang.org/pkg/net/http/
@sdreher sdreher merged commit 2918526 into master May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants