-
Notifications
You must be signed in to change notification settings - Fork 615
Set default H2 session timeout #1206
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
Comments
Nodejs introduced default timeout of 120 seconds on H2 server timeout very early on but reverted in nodejs/node#27558, because it introduced a lot surprice when it closes the connection unexpectedly. |
Greetings! We’re closing this issue because it has been open a long time and hasn’t been updated in a while and may not be getting the attention it deserves. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to comment or open a new issue. |
Another reason to add a session timeout is #1525 (comment) - clients would get an unexpected error if a load balancer silently drops an inactive HTTP/2 connection without closing it. It seems like many load balancers hosted by AWS services have a (configurable) default timeout of 300 seconds (after which many silently drop the connection), so my personal preference would be a value less than 300 seconds (such as 120 seconds) |
The revert in Node.js was done as it was surprising and problematic for users. We should not add a default session time out as:
Should this be handled by listening to timeout event instead? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
If a service supports H2, the client will contain an H2 request handler by default (i.e. kinesis, but current released client-kinesis uses H1 request handler still). If user make a request, the process doesn't return after the request is completed, unless the request handler is explicitly destroyed.
This is because the H2 request creates an H2 session everytime it establish an H2 connection. Since the connection doesn't close even in idle, the process doesn't return either.
It brings the problem that:
Describe the solution you'd like
Nodejs provides a setTimeout() config on H2 session object. It configs the session to be closed after a certain period of time if it's inactive. By default, there's no timeout.(It has 3 mins default timeout in reality because NginX has default 3 mins idle time)
I suggest the default value to be shorter than 3 mins so it won't hang users process meaninglessly for too long. The defautl value should be longer than couple of seconds otherwise we are losing the benefit of H2.
/cc @trivikr @alexforsyth
The text was updated successfully, but these errors were encountered: