You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cluster): support reusePort on server listen (#5754)
Add SO_REUSEPORT socket option support for server listen, which allows
multiple server sockets to bind to the same port with the OS
distributing incoming connections. This improves load balancing in
cluster scenarios.
- Add reusePort option to ClusterOptions interface
- Add platform validation (linux, freebsd, sunos, aix)
- Use server.listen({ port, reusePort, host }) when reusePort is enabled
- Handle message routing for reusePort (cluster doesn't emit 'listening'
event)
- Support reusePort in worker_threads mode (all workers share same port)
- Add test fixtures and tests for reusePort functionality
Synced from eggjs/cluster#115close#5728
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Added reusePort configuration option for cluster server listening.
When enabled on supported platforms, this allows multiple workers to
bind to the same port, improving socket reuse behavior and resource
utilization (default: false).
* **Tests**
* Added test coverage and fixture applications for reusePort
functionality.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments