-
Notifications
You must be signed in to change notification settings - Fork 37
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
ReadTimeout timer not resetting? #27
Comments
Hello. I don't understand your issue. I do, but I need more context. |
server := &fasthttp.Server{
ReadTimeout: 5 * time.Second,
Handler: ServeHTTP,
}
tlsConfig := &tls.Config{...}
http2.ConfigureServerAndConfig(server, tlsConfig)
listener, err := net.Listen("tcp4", "0.0.0.0:443")
if err != nil {
panic(err)
}
tlsListener := tls.NewListener(listener, tlsConfig)
err = server.Serve(tlsListener)
if err != nil {
panic(err)
} |
Are you sure you are using http2? The library doesn't have any kind of read timeout. It doesn't care about timeouts really. |
Also, when I remove |
Here is the problem. Is not related to http2. Is an issue related to fasthttp. |
I'll let the issue open here, and create a new one in fasthttp |
@GitRowin can you check the version v0.2.4? Thanks |
Connections are no longer being closed 5 seconds after connecting, but timeouts don't work at all now. |
Maybe you're misunderstanding the problem. ReadTimeout documentation:
Before v0.2.4, the read deadline was only reset when the connection opened, and now read and write timeouts are disabled completely. The expected behavior is the deadline resetting after the first byte of a HTTP request has been read. |
What are you expecting then? After 5 seconds return an error to the client? Which kind of error? An http2 specific code or an HTTP status? |
Try the version v0.2.5. I just send a cancel and remove the stream when the stream times out |
The timeout is not working: Server: server := &fasthttp.Server{
ReadTimeout: 5 * time.Second,
Handler: ServeHTTP,
} Also:
From: https://httpwg.org/specs/rfc7540.html#n-connection-management |
Oke, makes sense. I'll take a look later |
Hello, After taking a look I still don't understand what's the issue. I don't know if you mean if a request needs to timeout or the connection needs to be closed after the ReadTimeout. About the first one: I am working on an implementation for that (so same as fasthttp does |
@GitRowin can you try version v0.3.1? |
Keep-Alive connections get closed
ReadTimeout
seconds after connecting, even if they're actively being used to make HTTP requests:I'm using a
ReadTimeout
of 5 seconds. As you can see, 5 and 10 seconds after the initial request, the browser has to connect again.I believe this issue is basically the same as this one: golang/go#16450
The text was updated successfully, but these errors were encountered: