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

http: set lifo as the default scheduling strategy in Agent. #36685

Closed
wants to merge 1 commit into from

Conversation

mcollina
Copy link
Member

In #33278 we have added a scheduling option for our http.Agent to use a LIFO algorithm instead of FIFO. This greatly reduces the amount of ECONNRESET errors due to timeouts, and it's generically a better production experience for our users.

I propose to make this the default.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Dec 30, 2020
@mcollina mcollina added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 30, 2020
@mcollina
Copy link
Member Author

@nodejs/tsc can you please review?

@mcollina mcollina requested review from addaleax and jasnell December 30, 2020 12:06
@addaleax
Copy link
Member

I’d personally also be happy to land this as a semver-minor change.

@mcollina
Copy link
Member Author

I’d personally also be happy to land this as a semver-minor change.

I'm definitely ok with this. Would you backport down to v14?

@mcollina mcollina added semver-minor PRs that contain new features and should be released in the next minor version. baking-for-lts PRs that need to wait before landing in a LTS release. lts-watch-v14.x request-ci Add this label to start a Jenkins CI on a PR. and removed semver-major PRs that contain breaking changes and should be released in the next major version. labels Dec 30, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 30, 2020
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 30, 2020
@mcollina
Copy link
Member Author

cc @delvedor

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 30, 2020
Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

100% agree!
It should not be a semver major as the socket handling is transparent to the user :)

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

LGTM % an update to the scheduling documentation. It is still documented that fifo is the default :).

Changing it as semver-minor sounds good to me as well!

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 1, 2021
@nodejs-github-bot
Copy link
Collaborator

@mmarchini mmarchini added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Jan 5, 2021
@github-actions github-actions bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 5, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2021

Commit Queue failed
- Loading data for nodejs/node/pull/36685
✔  Done loading data for nodejs/node/pull/36685
----------------------------------- PR info ------------------------------------
Title      http: set lifo as the default scheduling strategy in Agent. (#36685)
Author     Matteo Collina  (@mcollina)
Branch     mcollina:default-lifo -> nodejs:master
Labels     baking-for-lts, dont-land-on-v10.x, dont-land-on-v12.x, http, lts-watch-v14.x, semver-minor
Commits    1
 - http: set lifo as the default scheduling strategy in Agent.
Committers 1
 - Matteo Collina 
PR-URL: https://github.com/nodejs/node/pull/36685
Reviewed-By: Anna Henningsen 
Reviewed-By: Michaël Zasso 
Reviewed-By: Robert Nagy 
Reviewed-By: James M Snell 
Reviewed-By: Luigi Pinca 
Reviewed-By: Daijiro Wachi 
Reviewed-By: Ruben Bridgewater 
Reviewed-By: Rich Trott 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/36685
Reviewed-By: Anna Henningsen 
Reviewed-By: Michaël Zasso 
Reviewed-By: Robert Nagy 
Reviewed-By: James M Snell 
Reviewed-By: Luigi Pinca 
Reviewed-By: Daijiro Wachi 
Reviewed-By: Ruben Bridgewater 
Reviewed-By: Rich Trott 
--------------------------------------------------------------------------------
   ✔  Last GitHub Actions successful
   ℹ  Last Full PR CI on 2021-01-05T21:15:34Z: https://ci.nodejs.org/job/node-test-pull-request/35312/
- Querying data for job/node-test-pull-request/35312/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
   ℹ  This PR was created on Wed, 30 Dec 2020 12:05:49 GMT
   ✔  Approvals: 8
   ✔  - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/36685#pullrequestreview-560024151
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/36685#pullrequestreview-560024681
   ✔  - Robert Nagy (@ronag): https://github.com/nodejs/node/pull/36685#pullrequestreview-560034670
   ✔  - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/36685#pullrequestreview-560059651
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/36685#pullrequestreview-560175591
   ✔  - Daijiro Wachi (@watilde): https://github.com/nodejs/node/pull/36685#pullrequestreview-560418195
   ✔  - Ruben Bridgewater (@BridgeAR) (TSC): https://github.com/nodejs/node/pull/36685#pullrequestreview-560564331
   ✔  - Rich Trott (@Trott) (TSC): https://github.com/nodejs/node/pull/36685#pullrequestreview-560647420
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/master up to date...
From https://github.com/nodejs/node
 * branch                  master     -> FETCH_HEAD
✔  origin/master is now up-to-date
- Downloading patch for 36685
From https://github.com/nodejs/node
 * branch                  refs/pull/36685/merge -> FETCH_HEAD
✔  Fetched commits as a3fcf24a6c2f..2b8c2f649209
--------------------------------------------------------------------------------
Auto-merging lib/_http_agent.js
Auto-merging doc/api/http.md
[master 83957d65c9] http: set lifo as the default scheduling strategy in Agent.
 Author: Matteo Collina 
 Date: Wed Dec 30 13:02:27 2020 +0100
 3 files changed, 8 insertions(+), 5 deletions(-)
   ✔  Patches applied
--------------------------------------------------------------------------------
--------------------------------- New Message ----------------------------------
http: set lifo as the default scheduling strategy in Agent.

PR-URL: #36685
Reviewed-By: Anna Henningsen anna@addaleax.net
Reviewed-By: Michaël Zasso targos@protonmail.com
Reviewed-By: Robert Nagy ronagy@icloud.com
Reviewed-By: James M Snell jasnell@gmail.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Daijiro Wachi daijiro.wachi@gmail.com
Reviewed-By: Ruben Bridgewater ruben@bridgewater.de
Reviewed-By: Rich Trott rtrott@gmail.com

[master 9a83efb9ce] http: set lifo as the default scheduling strategy in Agent.
Author: Matteo Collina hello@matteocollina.com
Date: Wed Dec 30 13:02:27 2020 +0100
3 files changed, 8 insertions(+), 5 deletions(-)
✖ 9a83efb9ce62f0772bf6dfa471dc8a35181adfc3
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 metadata is at end of message metadata-end
⚠ 0:50 Title should be <= 50 columns. title-length
✔ 1:8 PR-URL is valid. pr-url
✔ 0:0 reviewers are valid reviewers
✔ 0:0 valid subsystems subsystem
✖ 0:59 Do not use punctuation at end of title. title-format

ℹ Please fix the commit message and try again.

https://github.com/nodejs/node/actions/runs/464594830

@mcollina
Copy link
Member Author

mcollina commented Jan 6, 2021

Landed in 278c91c

@mcollina mcollina closed this Jan 6, 2021
mcollina added a commit that referenced this pull request Jan 6, 2021
PR-URL: #36685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@mcollina mcollina deleted the default-lifo branch January 8, 2021 09:35
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
PR-URL: #36685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request Jan 12, 2021
danielleadams added a commit that referenced this pull request Jan 12, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) [#29412](#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) [#36603](#36603)
* crypto:
  * implement basic secure heap support (James M Snell) [#36779](#36779)
  * fixup bug in keygen error handling (James M Snell) [#36779](#36779)
  * introduce X509Certificate API (James M Snell) [#36804](#36804)
  * implement randomuuid (James M Snell) [#36729](#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) [#36793](#36793)
  * add dnlup to collaborators (Daniele Belardi) [#36849](#36849)
  * add panva to collaborators (Filip Skokan) [#36802](#36802)
  * add yashLadha to collaborator (Yash Ladha) [#36666](#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) [#36685](#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) [#36623](#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) [#34291](#34291)
* v8:
  * fix native  constructors (ExE Boss) [#36549](#36549)
danielleadams added a commit that referenced this pull request Jan 12, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) [#29412](#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) [#36603](#36603)
* crypto:
  * implement basic secure heap support (James M Snell) [#36779](#36779)
  * fixup bug in keygen error handling (James M Snell) [#36779](#36779)
  * introduce X509Certificate API (James M Snell) [#36804](#36804)
  * implement randomuuid (James M Snell) [#36729](#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) [#36793](#36793)
  * add dnlup to collaborators (Daniele Belardi) [#36849](#36849)
  * add panva to collaborators (Filip Skokan) [#36802](#36802)
  * add yashLadha to collaborator (Yash Ladha) [#36666](#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) [#36685](#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) [#36623](#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) [#34291](#34291)
* v8:
  * fix native  constructors (ExE Boss) [#36549](#36549)
danielleadams added a commit that referenced this pull request Jan 13, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) [#29412](#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) [#36603](#36603)
* crypto:
  * implement basic secure heap support (James M Snell) [#36779](#36779)
  * fixup bug in keygen error handling (James M Snell) [#36779](#36779)
  * introduce X509Certificate API (James M Snell) [#36804](#36804)
  * implement randomuuid (James M Snell) [#36729](#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) [#36793](#36793)
  * add dnlup to collaborators (Daniele Belardi) [#36849](#36849)
  * add panva to collaborators (Filip Skokan) [#36802](#36802)
  * add yashLadha to collaborator (Yash Ladha) [#36666](#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) [#36685](#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) [#36623](#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) [#34291](#34291)
* v8:
  * fix native  constructors (ExE Boss) [#36549](#36549)
danielleadams added a commit that referenced this pull request Jan 13, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) [#29412](#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) [#36603](#36603)
* crypto:
  * implement basic secure heap support (James M Snell) [#36779](#36779)
  * fixup bug in keygen error handling (James M Snell) [#36779](#36779)
  * introduce X509Certificate API (James M Snell) [#36804](#36804)
  * implement randomuuid (James M Snell) [#36729](#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) [#36793](#36793)
  * add dnlup to collaborators (Daniele Belardi) [#36849](#36849)
  * add panva to collaborators (Filip Skokan) [#36802](#36802)
  * add yashLadha to collaborator (Yash Ladha) [#36666](#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) [#36685](#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) [#36623](#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) [#34291](#34291)
* v8:
  * fix native  constructors (ExE Boss) [#36549](#36549)
danielleadams added a commit that referenced this pull request Jan 13, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) [#29412](#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) [#36603](#36603)
* crypto:
  * implement basic secure heap support (James M Snell) [#36779](#36779)
  * fixup bug in keygen error handling (James M Snell) [#36779](#36779)
  * introduce X509Certificate API (James M Snell) [#36804](#36804)
  * implement randomuuid (James M Snell) [#36729](#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) [#36793](#36793)
  * add dnlup to collaborators (Daniele Belardi) [#36849](#36849)
  * add panva to collaborators (Filip Skokan) [#36802](#36802)
  * add yashLadha to collaborator (Yash Ladha) [#36666](#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) [#36685](#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) [#36623](#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) [#34291](#34291)
* v8:
  * fix native  constructors (ExE Boss) [#36549](#36549)
danielleadams added a commit that referenced this pull request Jan 14, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) [#29412](#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) [#36603](#36603)
* crypto:
  * implement basic secure heap support (James M Snell) [#36779](#36779)
  * fixup bug in keygen error handling (James M Snell) [#36779](#36779)
  * introduce X509Certificate API (James M Snell) [#36804](#36804)
  * implement randomuuid (James M Snell) [#36729](#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) [#36793](#36793)
  * add dnlup to collaborators (Daniele Belardi) [#36849](#36849)
  * add panva to collaborators (Filip Skokan) [#36802](#36802)
  * add yashLadha to collaborator (Yash Ladha) [#36666](#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) [#36685](#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) [#36623](#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) [#34291](#34291)
* v8:
  * fix native  constructors (ExE Boss) [#36549](#36549)
danielleadams added a commit that referenced this pull request Jan 14, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) (#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) (#36603)
* crypto:
  * implement basic secure heap support (James M Snell) (#36779)
  * fixup bug in keygen error handling (James M Snell) (#36779)
  * introduce X509Certificate API (James M Snell) (#36804)
  * implement randomuuid (James M Snell) (#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) (#36793)
  * add dnlup to collaborators (Daniele Belardi) (#36849)
  * add panva to collaborators (Filip Skokan) (#36802)
  * add yashLadha to collaborator (Yash Ladha) (#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) (#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) (#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) (#34291)
* v8:
  * fix native  constructors (ExE Boss) (#36549)
danielleadams added a commit that referenced this pull request Jan 15, 2021
PR-URL: #36889

Notable changes:

* child_process:
  * add 'overlapped' stdio flag (Thiago Padilha) (#29412)
  * support AbortSignal in fork (Benjamin Gruenbaum) (#36603)
* crypto:
  * implement basic secure heap support (James M Snell) (#36779)
  * fixup bug in keygen error handling (James M Snell) (#36779)
  * introduce X509Certificate API (James M Snell) (#36804)
  * implement randomuuid (James M Snell) (#36729)
* doc:
  * update release key for Danielle Adams (Danielle Adams) (#36793)
  * add dnlup to collaborators (Daniele Belardi) (#36849)
  * add panva to collaborators (Filip Skokan) (#36802)
  * add yashLadha to collaborator (Yash Ladha) (#36666)
* http:
  * set lifo as the default scheduling strategy in Agent (Matteo Collina) (#36685)
* net:
  * support abortSignal in server.listen (Nitzan Uziely) (#36623)
* process:
  * add direct access to rss without iterating pages (Adrien Maret) (#34291)
* v8:
  * fix native  constructors (ExE Boss) (#36549)
@mcollina
Copy link
Member Author

@nodejs/releasers could you add this to the next v14 release?

@targos targos removed baking-for-lts PRs that need to wait before landing in a LTS release. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Apr 14, 2021
@targos
Copy link
Member

targos commented Apr 14, 2021

@mcollina I cherry-picked it on v14.x-staging: f70aee0

targos pushed a commit that referenced this pull request Apr 14, 2021
PR-URL: #36685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
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. semver-minor PRs that contain new features and should be released in the next minor version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.