| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Since node 19, option keepAlive is true by default.
|
Review requested:
|
Sorry, something went wrong.
| header is explicitly specified or when the `keepAlive` and `maxSockets` | ||
| options are respectively set to `false` and `Infinity`, in which case | ||
| `Connection: close` will be used. **Default:** `false`. | ||
| `Connection: close` will be used. **Default:** `true`. |
There was a problem hiding this comment.
Line 111 in 99f6084
The default value is false.
Sorry, something went wrong.
There was a problem hiding this comment.
🤔
So a another line in doc is misleading.
Because
Line 557 in 99f6084
I understand the default value for a new Agent is falsy keepAlive, but the "default" globalAgent is set to true.
~ » nvm use system
Now using system version of node: v20.10.0 (npm v10.2.5)
--------------------------------------------------------------------------------------------------
~ » node -pe 'const {keepAlive, keepAliveMsecs} = http.globalAgent; ({keepAlive, keepAliveMsecs})'
{ keepAlive: true, keepAliveMsecs: 1000 }
~ » nvm use 18
Now using node v18.19.0 (npm v10.2.3)
--------------------------------------------------------------------------------------------------
~ » node -pe 'const {keepAlive, keepAliveMsecs} = http.globalAgent; ({keepAlive, keepAliveMsecs})'
{ keepAlive: false, keepAliveMsecs: 1000 }
To be complete, in our organization (https://www.radiofrance.fr/) we had some surprises with this change in our kubernetes infrastructure.
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, you are right: the misleading line is the one you linked above. In #43522 I changed some options for the default agent (while leaving the constructor behavior untouched).
Could you please update this PR to fix that offending line instead of the one you proposed?
Sorry, something went wrong.
There was a problem hiding this comment.
Done. I hope my changes are what you expect.
Sorry, something went wrong.
|
I don't think we should change the default value in the constructor. The global agent has uses a different value and that's ok. Anyway this PR is correct now so I'm dropping my request for changes. |
Sorry, something went wrong.
|
Why is this semver-major? |
Sorry, something went wrong.
It changes the default value of the keepAlive option in the http.Agent constructor from false to true. |
Sorry, something went wrong.
|
I agree, if we want the PR this way. But I don't think we want to flip the value on the code, just in the docs for the default agent (note: not the constructor, the default instance). |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Since node 19, option keepAlive is true by default.