mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[PR #1392] [MERGED] [TE] Add configurable handshake max length via MC_HANDSHAKE_MAX_LENGTH #2215
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#2215
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/Mooncake/pull/1392
Author: @herrluk
Created: 1/16/2026
Status: ✅ Merged
Merged: 1/22/2026
Merged by: @stmatengss
Base:
main← Head:feature/configurable-handshake-max-length📝 Commits (1)
90d797c[TE] Add configurable handshake max length via MC_HANDSHAKE_MAX_LENGTH📊 Changes
4 files changed (+63 additions, -2 deletions)
View changed files
📝
docs/source/design/transfer-engine/index.md(+1 -0)📝
docs/source/zh_archive/transfer-engine.md(+1 -0)📝
mooncake-transfer-engine/include/common.h(+37 -1)📝
mooncake-transfer-engine/tests/common_test.cpp(+24 -1)📄 Description
Summary
Add
MC_HANDSHAKE_MAX_LENGTHenvironment variable to configure the maximum handshake message length in P2P mode.Problem
When using P2P handshake mode with a single RDMA instance that registers many memory buffers (>10,000), the serialized segment metadata JSON can exceed the hardcoded 1MB limit, causing handshake failures with error:
Each registered buffer adds ~96 bytes to the JSON payload:
Solution
getHandshakeMaxLength()function that readsMC_HANDSHAKE_MAX_LENGTHresetHandshakeMaxLength()for testing purposesUsage
Type of Change
How Has This Been Tested?
Added unit tests in
common_test.cpp:ReturnsDefaultWhenEnvNotSet- verifies default 1MB valueReturnsCachedValue- verifies caching behaviorReadsCustomValueFromEnv- verifies custom value from environmentRejectsValueTooSmall- verifies rejection of values < 1MBRejectsValueTooLarge- verifies rejection of values > 128MBAcceptsMinimumValidValue- verifies 1MB boundaryAcceptsMaximumValidValue- verifies 128MB boundaryRejectsInvalidString- verifies handling of non-numeric inputChecklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.