-
-
Notifications
You must be signed in to change notification settings - Fork 117
Bump DefaultReadHeaderTimeout to 10s #84
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
Conversation
When dealing with slow networks and TLS, 200ms is often hit. Bump the default timeout to 10s, which is what crupto/tls uses for the TLS handshake. Closes: pires#83
94700b3
to
7f1f93d
Compare
@@ -12,7 +12,7 @@ import ( | |||
// be read from the wire, if Listener.ReaderHeaderTimeout is not set. | |||
// It's kept as a global variable so to make it easier to find and override, | |||
// e.g. go build -ldflags -X "github.com/pires/go-proxyproto.DefaultReadHeaderTimeout=1s" | |||
var DefaultReadHeaderTimeout = 200 * time.Millisecond | |||
var DefaultReadHeaderTimeout = 10 * time.Second |
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 you please add the reason here why this timeout? Or maybe just point to whatever const/var you mentioned is exposed by stdlib.
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.
There's no other reason than "it's a reasonable timeout".
@@ -265,6 +265,8 @@ func TestReadHeaderTimeoutIsReset(t *testing.T) { | |||
// we expect the actual address and port to be returned, | |||
// rather than the ProxyHeader we defined. | |||
func TestReadHeaderTimeoutIsEmpty(t *testing.T) { | |||
DefaultReadHeaderTimeout = 200 * time.Millisecond |
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.
I think this may have impact on subsequent tests, so maybe override the listener timeout instead.
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.
The point of the test is to check the default.
Gentle ping |
Sorry @emersion in between work and sickness, I just haven't been able to look into this. Thanks a lot for your contribution, once more! |
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.
LGTM
When dealing with slow networks and TLS, 200ms is often hit. Bump
the default timeout to 10s, which is what crupto/tls uses for the
TLS handshake.
Closes: #83