mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #4768] [Bug]: Stale NoF controllers and qpairs remain on the target after connection failures #1217
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#1217
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?
Originally created by @cage-goat on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/4768
Bug Report
Description
Following a network failure, the client may detect the connection failure and start recovery while the target has not yet detected that the old connections are no longer valid. The old controller and qpairs can remain on the target and continue consuming resources.
PR #4656 implements client-side controller recovery and qpair reconnection, but timely cleanup of stale target-side connections still needs to be addressed.
Mooncake currently sets
keep_alive_timeout_msto0for NoF clients, disabling NVMe Keep Alive. The target therefore cannot use Keep Alive expiration to detect an unresponsive client and reclaim its connections.Steps to Reproduce
Actual Behavior
After the client reconnects, the old controller and qpairs may remain on the target and continue consuming resources.
Expected Behavior
Support configurable KATO for NoF clients and continuously process the admin queue so that:
Before submitting...
@github-actions[bot] commented on GitHub (Oct 19, 2026):
Thanks for opening this issue, @cage-goat!
318081269A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@he-yufeng commented on GitHub (Oct 19, 2026):
The spot you identified is exactly where this lives:
ApplyCtrlrOptsFromEnv(mooncake-store/src/spdk/spdk_wrapper.cpp) hardcodeskeep_alive_timeout_ms = 0right before the other env-driven options are applied. The config plumbing precedent is already in place —SpdkControllerConfig::FromEnvironment()carriesnum_io_queues,io_queue_size,transport_ack_timeout,admin_queue_size,fabrics_connect_timeout_usand the digest flags — so aMC_STORE_SPDK_KEEP_ALIVE_TIMEOUT_MS(or similar) field would slot in the same way, default 0 to keep today's behavior for existing deployments.One design question worth nailing down before a PR: Keep Alive only works if the client's admin queue is actually being polled while idle — SPDK delivers keep-alive completion through admin-queue processing, and if Mooncake's NoF path only touches the admin queue at connect/disconnect time, setting a nonzero KATO on the client still leaves the target unable to reclaim. Whoever picks this up should check whether the transport has a background poll of the admin queue (or needs one) alongside the config plumbing. That check needs real NVMe-oF hardware to validate, so this is best authored by someone with a target to test against — if you have one and want to take it, a PR adding the config field + opts application + the admin-queue answer would be very welcome, and I'm happy to review.
(Related: #4656 covered client-side recovery; this target-side reclamation is its complement.)
@cage-goat commented on GitHub (Oct 19, 2026):
Thanks @he-yufeng! I've already opened #4769 to address this. It adds configurable KATO and builds on the controller thread introduced in #4656, which continues polling admin queues even when there is no data I/O.
I've also validated it against a standalone SPDK NVMe/TCP target backed by a malloc bdev:
These results are included in the PR description. I'd appreciate your review!