Skip to content

cluster: report EADDRINUSE when a worker listens twice on the same port - #65020

Open
islandryu wants to merge 2 commits into
nodejs:mainfrom
islandryu:worktree-cluster-eaddrinuse-64869
Open

islandryu wants to merge 2 commits into
nodejs:mainfrom
islandryu:worktree-cluster-eaddrinuse-64869

Conversation

@islandryu

@islandryu islandryu commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes: #64869

Prevent an assertion error in child.js when a worker attempts to listen twice on the same port by detecting duplicate handle registrations in the primary process.

@nodejs-github-bot nodejs-github-bot added cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run. labels Aug 4, 2026
Fixes: nodejs#64869
Signed-off-by: islandryu <shimaryuhei@gmail.com>
@islandryu
islandryu force-pushed the worktree-cluster-eaddrinuse-64869 branch from bd5c12f to ed8f6a3 Compare August 7, 2026 14:29
@islandryu
islandryu marked this pull request as ready for review August 7, 2026 15:22
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (facd71e) to head (d095f6e).
⚠️ Report is 1726 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65020      +/-   ##
==========================================
+ Coverage   90.04%   90.14%   +0.10%     
==========================================
  Files         713      751      +38     
  Lines      224950   252648   +27698     
  Branches    42530    47542    +5012     
==========================================
+ Hits       202548   227754   +25206     
- Misses      14188    16182    +1994     
- Partials     8214     8712     +498     
Files with missing lines Coverage Δ
lib/internal/cluster/primary.js 94.75% <100.00%> (+0.14%) ⬆️

... and 461 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a suggestion for the test: it passes on an unpatched build under SCHED_RR (the POSIX default), so it wouldn't catch a regression on Linux/macOS. The PR fixes behavior with SCHED_NONE, so could the tests cover both SCHED_RR and SCHED_NONE policies regardless of the OS?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch! I've covered both policies.

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 25, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 25, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Sep 15, 2026
@github-actions github-actions Bot added request-ci-failed Starting CI with the request-ci label failed and requires manual intervention. and removed request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Failed to start CI
- Validating Jenkins credentials
✔  Jenkins credentials valid
- Querying data for job/node-test-pull-request/76474/
✔  Build data downloaded
   ℹ  Existing CI run found: https://ci.nodejs.org/job/node-test-pull-request/76474/
   ✖  Refusing to start a potentially duplicate CI job. Use the "Resume build" button in the Jenkins UI, or start a new CI manually.
https://github.com/nodejs/node/actions/runs/34959502102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cluster Issues and PRs related to the cluster subsystem. needs-ci PRs that need a full CI run. request-ci-failed Starting CI with the request-ci label failed and requires manual intervention.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cluster: ERR_INTERNAL_ASSERTION when a worker listens twice on the same host:port (Windows, regression from #60141)

4 participants