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

Fix leaking http connections #147

Merged
merged 3 commits into from Feb 10, 2017
Merged

Fix leaking http connections #147

merged 3 commits into from Feb 10, 2017

Conversation

mkabischev
Copy link
Contributor

We faced problems with leaking http connections. We receive hooks by http, all connections are keep-alived. After few hours of our testing we noticed that we`ve got ~400 opened connections despite of hardcoded limit to 20. Also we had same number of goroutines both on server & client sides.

Default http client runs standalone goroutine for every connection so code in Expired doesn`t close these connections it just set client to nil. And new created client opens and runs new goroutines for new connection.

@tidwall
Copy link
Owner

tidwall commented Feb 10, 2017

Wow. This looks much cleaner. Thanks.

@tidwall tidwall merged commit 0617593 into tidwall:master Feb 10, 2017
@tidwall
Copy link
Owner

tidwall commented Feb 10, 2017

It works on my side. Big thanks!

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.

None yet

2 participants