Skip to content

Use Keep-Alive by default in global agents and close idle connections in server#43522

Closed
ShogunPanda wants to merge 1 commit into
nodejs:mainfrom
ShogunPanda:default-agent
Closed

Use Keep-Alive by default in global agents and close idle connections in server#43522
ShogunPanda wants to merge 1 commit into
nodejs:mainfrom
ShogunPanda:default-agent

Conversation

@ShogunPanda

Copy link
Copy Markdown
Contributor

This PR introduces the following changes:

  1. Both http.globalAgent and https.globalAgent use keep-alive by default.
  2. Agent now parses and applies Keep-Alive headers received by the server (if smaller than the current agent timeout)
  3. http(s).Server.close now calls closeIdleConnections internally.

Fixes: #37184

@ShogunPanda ShogunPanda requested review from mcollina and ronag June 21, 2022 12:59
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. needs-ci PRs that need a full CI run. labels Jun 21, 2022
@mcollina mcollina added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jun 21, 2022

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mcollina

Copy link
Copy Markdown
Member

cc @nodejs/tsc

also @mscdex

Comment thread lib/_http_agent.js Outdated
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

cc @nodejs/tsc this needs another approval

@Trott

Trott commented Jun 27, 2022

Copy link
Copy Markdown
Member

cc @nodejs/tsc this needs another approval

It has two TSC approvals already (you and Antoine), so I think it's good as far as our landing-a-semver-major rules go. (However, I wouldn't discourage someone else from reviewing!)

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Trott commented Jun 27, 2022

Copy link
Copy Markdown
Member

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@ShogunPanda

Copy link
Copy Markdown
Contributor Author

Landed in 4267b92

ShogunPanda added a commit that referenced this pull request Jun 29, 2022
PR-URL: #43522
Fixes: #37184
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@ShogunPanda ShogunPanda deleted the default-agent branch June 29, 2022 10:49
@tniessen tniessen mentioned this pull request Jul 1, 2022
@mcollina mcollina mentioned this pull request Oct 21, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues or PRs related to the http subsystem. https Issues or PRs related to the https subsystem. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set a default (http|https).Agent with keep-alive

5 participants