Repository navigation
feat: implement source IP affinity for cluster workers - #4
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement actual TCP source-IP affinity for
cluster.sticky: "ip", replacing the previous round-robin placeholder. Master selects stable Worker slots with rendezvous hashing and hands paused sockets over a bounded offer/prepare/commit protocol. All five built-in adapters and their official factories use the shared Node HTTP receiver; Fastify uses its public serverFactory. The default remainssticky: "none".Workers entering local application shutdown withdraw new-connection eligibility before closing resources, while in-flight connections keep the existing shutdown budget. Local exits retain automatic recovery in the same slot; Master-initiated draining does not create duplicate replacements. Readiness is rechecked immediately before slot activation, and forceClose errors are recorded without skipping subsequent cleanup. Chinese guidance and English guidance describe the matching behavior and IPC contract.
Validation:
818baeb148e0f87efbfeb4b94c2c2f30930f9601: CI run 38003622430, passed all 16 jobs. The full coverage run passed 4,469 tests (2 conditional skips) across 228 files with the existing thresholds. Windows passed 158 tests with 5 platform skips, including the new local-shutdown and Worker force-close regressions.No package version or tag changes are included.