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

adding tcp keepalive support for the broker's tcp connection #407

Closed
epsniff opened this issue Apr 3, 2015 · 3 comments
Closed

adding tcp keepalive support for the broker's tcp connection #407

epsniff opened this issue Apr 3, 2015 · 3 comments

Comments

@epsniff
Copy link
Contributor

epsniff commented Apr 3, 2015

We've been using the sarama client on Google Compute Engine (GCE) and it works well, expect that once in a while we get read tcp 10.240.20.4:9093: i/o timeout. This occurs often with Go sockets on GCE, because GCE kills idle connections after 10 mins and by default Go's net package turns off tcp keepalives.

I've created a small patch to support keepalives: lytics@76aa551. Let me know if you have any feedback? We're currently running these changes through our staging environment to see this fixes the issue.

Ref: https://cloud.google.com/compute/docs/troubleshooting#communicatewithinternet

thanks for all your hard work!!!

@eapache
Copy link
Contributor

eapache commented Apr 3, 2015

Sounds like a good idea, although based on http://felixge.de/2014/08/26/tcp-keepalive-with-golang.html it looks like keepalives in golang are rather inconsistent across platforms. For style, you may want to take a look at #154 which also adds parameters to the dialer; it may be cleaner to follow that pattern than to wrap it up in an extra function.

@epsniff
Copy link
Contributor Author

epsniff commented Apr 3, 2015

Thank you for looking. Ill look at both and clean up the code accordingly.

@epsniff
Copy link
Contributor Author

epsniff commented Apr 6, 2015

Closing the ticket after my PR got merged.

@epsniff epsniff closed this as completed Apr 6, 2015
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

No branches or pull requests

2 participants