Repository navigation
[TransferEngine] Enable TCP connection pool by default - #3569
Merged
Merged
Conversation
alogfans
requested review from
chestnut-Q,
doujiang24 and
staryxchen
as code owners
August 21, 2026 06:56
Contributor
There was a problem hiding this comment.
Pull request overview
Enables the TCP transport’s connection-pool path by default in TcpTransport, making sustained TCP transfers less likely to exhaust ephemeral ports unless pooling is explicitly disabled via MC_TCP_ENABLE_CONNECTION_POOL.
Changes:
- Default
TcpTransportto use the connection pool (enable_connection_pool_ = true) unlessMC_TCP_ENABLE_CONNECTION_POOLis set to a disable value.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| std::atomic_bool running_; | ||
| std::thread thread_; | ||
| bool enable_connection_pool_ = false; | ||
| bool enable_connection_pool_ = true; |
This was referenced Sep 21, 2026
This was referenced Oct 4, 2026
alogfans
pushed a commit
that referenced
this pull request
Oct 7, 2026
The pool has been enabled by default since #3569, but the docs still present it as opt-in and the troubleshooting guide's "known limitations" describe the removed dynamic pool (cleanupIdleConnections, pool_mutex_), not the lane-based implementation the flag now selects. - index.md: document the default-on behavior, the bounded per-peer lanes, the clean-exchange reuse rule, and the 0/false/no opt-out. - troubleshooting.md: reframe the ephemeral-port fix around the default, and replace the stale limitations with the lane implementation's actual caveats (no idle reaping, no keepalive probe on reuse, dirty-socket discard + lane cooldown retry). Verified with sphinx html build (no warnings on either page) and pre-commit run --files on both files.
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.
Description
Enable the TCP connection pool by default for TCP transport. Close #3540
Without
MC_TCP_ENABLE_CONNECTION_POOLenabled, services that rely on sustained TCP transfers can fail to start or quickly run into socket/ephemeral-port exhaustion. This change makes the pooled connection path the default while preserving the existing rollback behavior:MC_TCP_ENABLE_CONNECTION_POOLunset: connection pool enabledMC_TCP_ENABLE_CONNECTION_POOL=1/true/yes: connection pool enabledMC_TCP_ENABLE_CONNECTION_POOL=0/false/no: connection pool disabledDocs were updated to reflect the new default and the explicit disable values.
Module
mooncake-transfer-engine)mooncake-store)mooncake-reshard)mooncake-ep)mooncake-pg)mooncake-integration)mooncake-p2p-store)mooncake-wheel)mooncake-common)mooncake-rl)Type of Change
How Has This Been Tested?
Test commands:
Test results:
tcp_write_visibility_testChecklist
./scripts/code_format.shAI Assistance Disclosure
Codex was used to make the scoped code/docs update and run local build/test checks. Human review is still required for all changed lines.