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

net: add UV_TCP_REUSEPORT for tcp #55408

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

theanarkh
Copy link
Contributor

SO_REUSEPORT allows users bind a port to multiple sockets, and incoming connections are distributed by OS across the listener sockets. It will improve the performance of server.

Refs: libuv/libuv#4407

  • 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
Copy link
Collaborator

Review requested:

  • @nodejs/net

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. net Issues and PRs related to the net subsystem. labels Oct 16, 2024
@theanarkh theanarkh force-pushed the add_reuseport_for_tcp branch 2 times, most recently from e6cdae7 to 3cd2331 Compare October 16, 2024 18:03
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.41%. Comparing base (7a7c2b3) to head (0b06319).
Report is 68 commits behind head on main.

Files with missing lines Patch % Lines
src/tcp_wrap.cc 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55408      +/-   ##
==========================================
- Coverage   88.41%   88.41%   -0.01%     
==========================================
  Files         652      653       +1     
  Lines      186878   187527     +649     
  Branches    36061    36105      +44     
==========================================
+ Hits       165236   165804     +568     
- Misses      14895    14956      +61     
- Partials     6747     6767      +20     
Files with missing lines Coverage Δ
lib/net.js 95.12% <100.00%> (+0.01%) ⬆️
src/tcp_wrap.cc 80.32% <66.66%> (+0.32%) ⬆️

... and 116 files with indirect coverage changes

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 17, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 17, 2024
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

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

This is amazing!
LGTM!

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 17, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 17, 2024
@nodejs-github-bot

This comment was marked as outdated.

@mcollina mcollina added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 17, 2024
@theanarkh theanarkh removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 17, 2024
@addaleax
Copy link
Member

Title should be net: add UV_TCP_REUSEPORT, right?

@theanarkh theanarkh changed the title lib: add UV_TCP_REUSEPORT for tcp net: add UV_TCP_REUSEPORT for tcp Oct 17, 2024
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 18, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 18, 2024
@nodejs-github-bot

This comment was marked as outdated.

doc/api/net.md Outdated Show resolved Hide resolved
test/common/net.js Outdated Show resolved Hide resolved
test/parallel/test-child-process-net-reuseport.js Outdated Show resolved Hide resolved
test/common/net.js Outdated Show resolved Hide resolved
test/common/net.js Outdated Show resolved Hide resolved
test/parallel/test-child-process-net-reuseport.js Outdated Show resolved Hide resolved
test/parallel/test-child-process-net-reuseport.js Outdated Show resolved Hide resolved
test/parallel/test-cluster-net-reuseport.js Outdated Show resolved Hide resolved
test/parallel/test-net-reuseport.js Outdated Show resolved Hide resolved
test/parallel/test-net-reuseport.js Show resolved Hide resolved
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 18, 2024
test/common/net.js Outdated Show resolved Hide resolved
@theanarkh theanarkh added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 20, 2024
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Oct 20, 2024

@lpinca lpinca added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 21, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 21, 2024
@nodejs-github-bot nodejs-github-bot merged commit 7bc3e16 into nodejs:main Oct 21, 2024
60 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 7bc3e16

@lpinca lpinca added the semver-minor PRs that contain new features and should be released in the next minor version. label Oct 22, 2024
aduh95 pushed a commit that referenced this pull request Oct 23, 2024
PR-URL: #55408
Refs: libuv/libuv#4407
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 added a commit that referenced this pull request Oct 24, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) #55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) #55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) #55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) #55398

PR-URL: TODO
@aduh95 aduh95 mentioned this pull request Oct 24, 2024
aduh95 added a commit that referenced this pull request Oct 24, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) #55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) #55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) #55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) #55398

PR-URL: #55513
aduh95 added a commit that referenced this pull request Oct 24, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) #55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) #55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) #55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) #55398

PR-URL: #55513
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
PR-URL: nodejs#55408
Refs: libuv/libuv#4407
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
louwers pushed a commit to louwers/node that referenced this pull request Nov 2, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) nodejs#54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) nodejs#55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) nodejs#55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) nodejs#55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) nodejs#55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) nodejs#55398

PR-URL: nodejs#55513
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
PR-URL: nodejs#55408
Refs: libuv/libuv#4407
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make `assertion_error` use Myers diff algorithm (Giovanni Bucci) nodejs#54862
buffer:
  * (SEMVER-MINOR) make `Buffer` work with resizable `ArrayBuffer` (James M Snell) nodejs#55377
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) nodejs#55333
lib:
  * (SEMVER-MINOR) add `UV_UDP_REUSEPORT` for udp (theanarkh) nodejs#55403
net:
  * (SEMVER-MINOR) add `UV_TCP_REUSEPORT` for tcp (theanarkh) nodejs#55408
test_runner:
  * mark `MockTimers` as stable (Erick Wendel) nodejs#55398

PR-URL: nodejs#55513
ruyadorno pushed a commit that referenced this pull request Nov 27, 2024
PR-URL: #55408
Refs: libuv/libuv#4407
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Paolo Insogna <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
github-actions bot pushed a commit that referenced this pull request Nov 27, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make assertion_error use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make Buffer work with resizable ArrayBuffer (James M Snell) #55377
crypto:
  * update root certificates to NSS 3.104 (Richard Lau) #55681
doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
  * add jazelly to collaborators (Jason Zhang) #55531
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
http:
  * (SEMVER-MINOR) add diagnostic channel `http.client.request.created` (Marco Ippolito) #55586
lib:
  * (SEMVER-MINOR) add UV_UDP_REUSEPORT for udp (theanarkh) #55403
module:
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
net:
  * (SEMVER-MINOR) add UV_TCP_REUSEPORT for tcp (theanarkh) #55408
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) #54181
tools:
  * fix root certificate updater (Richard Lau) #55681
util:
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: TODO
github-actions bot pushed a commit that referenced this pull request Nov 27, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make assertion_error use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make Buffer work with resizable ArrayBuffer (James M Snell) #55377
crypto:
  * update root certificates to NSS 3.104 (Richard Lau) #55681
doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
  * add jazelly to collaborators (Jason Zhang) #55531
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
http:
  * (SEMVER-MINOR) add diagnostic channel `http.client.request.created` (Marco Ippolito) #55586
lib:
  * (SEMVER-MINOR) add UV_UDP_REUSEPORT for udp (theanarkh) #55403
module:
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
net:
  * (SEMVER-MINOR) add UV_TCP_REUSEPORT for tcp (theanarkh) #55408
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) #54181
tools:
  * fix root certificate updater (Richard Lau) #55681
util:
  * (SEMVER-MINOR) fix util.getCallSites plurality (Chengzhong Wu) #55626

PR-URL: #56040
ruyadorno added a commit that referenced this pull request Nov 28, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make assertion_error use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make Buffer work with resizable ArrayBuffer (James M Snell) #55377
crypto:
  * update root certificates to NSS 3.104 (Richard Lau) #55681
doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
  * add jazelly to collaborators (Jason Zhang) #55531
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
http:
  * (SEMVER-MINOR) add diagnostic channel `http.client.request.created` (Marco Ippolito) #55586
lib:
  * (SEMVER-MINOR) add UV_UDP_REUSEPORT for udp (theanarkh) #55403
module:
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
net:
  * (SEMVER-MINOR) add UV_TCP_REUSEPORT for tcp (theanarkh) #55408
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) #54181
tools:
  * fix root certificate updater (Richard Lau) #55681

PR-URL: #56040
ruyadorno added a commit that referenced this pull request Nov 28, 2024
Notable changes:

assert:
  * (SEMVER-MINOR) make assertion_error use Myers diff algorithm (Giovanni Bucci) #54862
buffer:
  * (SEMVER-MINOR) make Buffer work with resizable ArrayBuffer (James M Snell) #55377
crypto:
  * update root certificates to NSS 3.104 (Richard Lau) #55681
doc:
  * enforce strict policy to semver-major releases (Rafael Gonzaga) #55732
  * add jazelly to collaborators (Jason Zhang) #55531
esm:
  * mark import attributes and JSON module as stable (Nicolò Ribaudo) #55333
http:
  * (SEMVER-MINOR) add diagnostic channel `http.client.request.created` (Marco Ippolito) #55586
lib:
  * (SEMVER-MINOR) add UV_UDP_REUSEPORT for udp (theanarkh) #55403
module:
  * (SEMVER-MINOR) unflag --experimental-require-module (Joyee Cheung) #55085
net:
  * (SEMVER-MINOR) add UV_TCP_REUSEPORT for tcp (theanarkh) #55408
sqlite:
  * (SEMVER-MINOR) add support for SQLite Session Extension (Bart Louwers) #54181
tools:
  * fix root certificate updater (Richard Lau) #55681

PR-URL: #56040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. net Issues and PRs related to the net 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.

6 participants