Skip to content
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: add note regarding net.Socket default timeout #31379

Closed
wants to merge 3 commits into from

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jan 16, 2020

Adding a note stating the difference between default timeout on http[2s] servers and on net.Socket.

Should be backported to v10 as well.

Fixes: #31378
Fixes: #27556
Refs: #27704

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. net Issues and PRs related to the net subsystem. v12.x labels Jan 16, 2020
@aduh95 aduh95 changed the title [v12.x] doc: update net.Socket timeout default value [v12.x] doc: add note regarding net.Socket default timeout Jan 16, 2020
@mscdex
Copy link
Contributor

mscdex commented Jan 16, 2020

This should also be added to master for consistency.

@mscdex
Copy link
Contributor

mscdex commented Jan 16, 2020

Also, this kind of note should probably be moved to each of the separate, relevant (http/https/http2) module documentations for better visibility.

doc/api/net.md Outdated Show resolved Hide resolved
@MylesBorins
Copy link
Contributor

Reviewing this it seems like perhaps this should target master and then get backported to 12.x.

If it is relevant to master we really shouldn't start with targeting LTS

@aduh95 aduh95 changed the base branch from v12.x-staging to master January 31, 2020 10:23
@aduh95 aduh95 changed the title [v12.x] doc: add note regarding net.Socket default timeout doc: add note regarding net.Socket default timeout Jan 31, 2020
Prior to Node.js v13, http[2s] have a specific default timeout value
which should not be confused with net.Socket default timeout.

Fixes: nodejs#31378
Fixes: nodejs#27556
Refs: nodejs#27704
aduh95 and others added 2 commits January 31, 2020 05:30
Co-Authored-By: Rich Trott <rtrott@gmail.com>
@aduh95
Copy link
Contributor Author

aduh95 commented Jan 31, 2020

Also, this kind of note should probably be moved to each of the separate, relevant (http/https/http2) module documentations for better visibility.

To me, docs there are already specific enough regarding the default timeout value, what are the changes you suggest @mscdex?

@mscdex
Copy link
Contributor

mscdex commented Feb 3, 2020

@aduh95 I meant the change in default timeout should be noted in the documentation for each appropriate subsystem, most likely listed in the changes: YAML somewhere. The reason I believe this change shouldn't be made in the net documentation is that I don't think most people using the http* modules are going to know to find these details in the documentation for net.

@@ -895,6 +895,9 @@ added: v0.1.90
Sets the socket to timeout after `timeout` milliseconds of inactivity on
the socket. By default `net.Socket` do not have a timeout.

Prior to Node.js 13.0.0, [`http.Server`][], [`https.Server`][] and
[`http2.Http2Server`][] have a different default socket timeout value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we incorporate this information into the YAML matter instead of having it here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we incorporate this information into the YAML matter instead of having it here?

Oh, wait, no, not that YAML matter. What's the rationale for putting this in net instead of http, https, and http2 docs?

Copy link
Contributor Author

@aduh95 aduh95 Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently some users are referring to net docs when working with http.Server (see #31378); prior to Node.js 13, default values are consistent across all sockets in Node.js codebase EXCEPT for the timeout, I figured adding a note would help avoid the confusion.
Users who refer to http[s2] docs already have the correct information, I'm not sure there is much confusion from that side.

@Trott
Copy link
Member

Trott commented Feb 3, 2020

Also, this kind of note should probably be moved to each of the separate, relevant (http/https/http2) module documentations for better visibility.

To me, docs there are already specific enough regarding the default timeout value, what are the changes you suggest @mscdex?

In that case, can we just leave it out here?