-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
internal/http_api: update NewDeadlineTransport() with new go http features #946
Conversation
When #942 was opened my thought was "why drop support for go-1.6 before having a good specific reason" - my C code works on compilers (and thus linux distros) from around the time Go was first released as beta. Anyway, here's a good reason I guess. Reminder to self to update https://github.com/nsqio/nsqio.github.io/blob/master/_posts/2014-03-01-installing.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 ping here once you are ready for this to land?
if err != nil { | ||
return nil, err | ||
} | ||
return &deadlinedConn{connectTimeout, c}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we drop the deadlinedConn
struct/methods above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch, silly of me to leave that stuff
2358d54
to
6def508
Compare
I plan to roll this out to a few servers tomorrow, and see how it does over a week or so. |
…tures More timeouts and limits were added to http.Transport in go-1.7. Some that were enabled in http.DefaultTransport ended up disabled in nsq's with-custom-timeouts http.Transport. IdleConnTimeout in particular is helpful.
6def508
to
51d9895
Compare
(rebased just for testing purposes) |
Everything seems to work. I'd say go ahead and merge this now. I don't have the patience to complete the fully scientific side-by-side test case where I go a full week without touching two nsqadmin instances, one with this update and one without. I had it set up but one of the nsqadmin instances was used just now (for a legitimate purpose by a co-worker). I can set up a better test with some more effort but it'll be another week to reproduce the original problem. I'll still probably make an attempt, but I think this is probably a good general update, which is at least now sanity-tested to not immediately break anything. |
More timeouts and limits were added to http.Transport in go-1.7.
Some that were enabled in http.DefaultTransport ended up disabled
in nsq's with-custom-timeouts http.Transport.
IdleConnTimeout in particular is helpful.
see DefaultTransport at https://golang.org/pkg/net/http/#RoundTripper
Not yet field-tested :)