Skip to content

Conversation

@islandryu
Copy link
Member

@islandryu islandryu commented Oct 7, 2025

Fixes: #60086

If the message.index passed to queryServer becomes out of sync due to errors or other issues, it may prevent a cluster from reusing a port that was acquired by another cluster.
To address this, I modified the code so that the handle key no longer includes the index (except when the port number is 0), and only the latest handle corresponding to a successfully acquired port is stored.

@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 Oct 7, 2025
@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.52%. Comparing base (cff138c) to head (7a1b5b4).
⚠️ Report is 100 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60141      +/-   ##
==========================================
+ Coverage   88.45%   88.52%   +0.06%     
==========================================
  Files         703      703              
  Lines      207546   207821     +275     
  Branches    40016    40014       -2     
==========================================
+ Hits       183595   183977     +382     
+ Misses      15956    15857      -99     
+ Partials     7995     7987       -8     
Files with missing lines Coverage Δ
lib/internal/cluster/primary.js 94.60% <100.00%> (+0.13%) ⬆️
lib/internal/cluster/round_robin_handle.js 95.80% <100.00%> (+0.12%) ⬆️
lib/internal/cluster/shared_handle.js 100.00% <100.00%> (ø)

... and 99 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.

@hgardneriv
Copy link

@islandryu - Thank you for proposing this change, the underlying issue is causing trouble for us with TCP, UDP, and HTTP servers: #60086. Any chance of getting this merged anytime in the near future?

@islandryu
Copy link
Member Author

We’ll need to get this reviewed before it can move forward.

@nodejs/cluster
would anyone be able to take a look?

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not all processes rebind when switching from :: to 0.0.0.0 or vice versa

3 participants