-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
http - keepalive timeout hint #34560
Labels
http
Issues or PRs related to the http subsystem.
Comments
@nodejs/http @nodejs/web-server-frameworks |
I think implementing this on both sides (client and server) would be very handy. Do we have a clue if other browsers/clients support this header? |
Mozilla seems to support it. |
4 tasks
ronag
added a commit
to nxtedition/node
that referenced
this issue
Jul 30, 2020
In http 1.1 persistent connection protocol there is a timing race where the client sends the request and then the server kills the connection (due to inactivity) before receiving the client's request. By providing a keep-alive header it is possible to provide the client a hint of when idle timeout would occur and avoid the race. Fixes: nodejs#34560
codebytere
pushed a commit
that referenced
this issue
Aug 5, 2020
In http 1.1 persistent connection protocol there is a timing race where the client sends the request and then the server kills the connection (due to inactivity) before receiving the client's request. By providing a keep-alive header it is possible to provide the client a hint of when idle timeout would occur and avoid the race. Fixes: #34560 PR-URL: #34561 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
addaleax
pushed a commit
that referenced
this issue
Sep 22, 2020
In http 1.1 persistent connection protocol there is a timing race where the client sends the request and then the server kills the connection (due to inactivity) before receiving the client's request. By providing a keep-alive header it is possible to provide the client a hint of when idle timeout would occur and avoid the race. Fixes: #34560 PR-URL: #34561 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
addaleax
pushed a commit
that referenced
this issue
Sep 22, 2020
In http 1.1 persistent connection protocol there is a timing race where the client sends the request and then the server kills the connection (due to inactivity) before receiving the client's request. By providing a keep-alive header it is possible to provide the client a hint of when idle timeout would occur and avoid the race. Fixes: #34560 PR-URL: #34561 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Having the server send a keep-alive header to the client with keep alive timeout hints would be useful.
In http 1.1 persistent connection protocol there is a timing race where the client sends the request and then the server kills the connection (due to inactivity) before receiving the client's request.
Currently the only way to mitigate this is to ensure the client has a shorter idle timeout than the server. Which currently is only guesswork unless you know the exact server settings/behavior. Providing a hint for the client would help alleviate this problem.
nginx does this:
Originally posted by @mcollina in nodejs/undici#273 (comment)
A follow up for this would be to have the http client implement the corresponding functionality (i.e. reduce idle timeout based on hint).
The text was updated successfully, but these errors were encountered: