-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: clarify socket and keepAliveTimeout interaction #25748
doc: clarify socket and keepAliveTimeout interaction #25748
Conversation
344dfc6
to
4696232
Compare
The subsystem prefix in commit messages for doc-only changes should be |
@@ -901,6 +901,10 @@ also be accessed at `request.connection`. | |||
This event can also be explicitly emitted by users to inject connections | |||
into the HTTP server. In that case, any [`Duplex`][] stream can be passed. | |||
|
|||
If `socket.setTimeout()` is called here, note that the timeout will |
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.
If `socket.setTimeout()` is called here, note that the timeout will | |
If `socket.setTimeout()` is called here, the timeout will |
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.
@Trott Are we landing as is or can we add this fix on landing?
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.
@inversion are you ok with @Trott suggestion? If so please accept it so this can land.
Thank you.
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.
My change is non-blocking. It's not crucial that note that
be removed. (It can also be removed by someone else who is landing this--just push to the branch. Or it can be removed in a subsequent PR as I imagine there are lots of opportunities for cleanup in the doc file.)
Hi, @inversion! Welcome and thanks for the pull request! Sorry to hear that this behavior caused you some grief! /ping @nodejs/http to confirm that the behavior described here is correct and is currently undocumented. /ping @nodejs/documentation Maybe there's a way to simplify or clarify the wording here a bit? Maybe a small piece of sample code with comments indicating the values and when they change? Or is that too much documentation real estate to describe what is likely an edge case? |
I'll fix this, probably worth adding it to https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines |
Socket timeouts set using the `connection` event are replaced by server.keepAliveTimeout when a response is handled.
4696232
to
5f761e9
Compare
I fixed up the commit message subsystem, rebased against master, and force-pushed. Lite CI: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/2423/ |
Thanks very much @Trott ! |
@nodejs/collaborators This could use another review. |
`Socket.prototype.setTimeout()` clears the previous timer before setting a new one. Refs: nodejs#25748 (comment)
`Socket.prototype.setTimeout()` clears the previous timer before setting a new one. Refs: #25748 (comment) PR-URL: #25928 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
`Socket.prototype.setTimeout()` clears the previous timer before setting a new one. Refs: #25748 (comment) PR-URL: #25928 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
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
Landed in 02601c2. |
Socket timeouts set using the `'connection'` event are replaced by `server.keepAliveTimeout` when a response is handled. PR-URL: #25748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Socket timeouts set using the `'connection'` event are replaced by `server.keepAliveTimeout` when a response is handled. PR-URL: #25748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
doc: clarify socket and keepAliveTimeout interaction
Socket timeouts set using the
connection
event are replaced byserver.keepAliveTimeout when a response is handled.
Socket timeouts set in the
connection
event are replaced after a response is sent in theresOnFinish
handlerIn this case, the socket timeout is 60 seconds until a response is sent, at which point it becomes 5 seconds (the server.keepAliveTimeout default). This bit me when working with load balancers that maintain long-lived connections.
I have added a note to the
connection
event docs to the effect that is preferred to useserver.keepAliveTimeout
.Checklist