mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #3637] [tent] BoundedMPSCQueue push() livelock: full submit queue spins both producers and RDMA worker threads forever, engine never recovers #928
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#928
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 @ai2open on GitHub (Aug 24, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/3637
Summary
In the TENT RDMA transport,
BoundedMPSCQueue::push()spins withstd::this_thread::yield()when the queue is full — it has no failure or blocking exit. Once a per-worker submit queue (capacity 8192) fills up during a sustained transfer-failure period, the RDMA worker thread itself blocks inpush()while re-enqueueing retried slices, stops popping, and every producer thread then spins inpush()as well. The whole transfer engine livelocks: no WRs are posted, no logs are emitted, and the engine cannot recover even after the underlying RDMA problem clears — only a process restart unwedges it.This is very likely the mechanism behind the
submit blocked ... pending in the thousands that never drains (wr_count=0)symptom observed in #3596.Environment
mooncake-transfer-engine(TENT,MC_USE_TENT=1), vLLM P/D disaggregation, KV blocks striped across 8 RoCE rails viabatch_transfer_sync_writemain(3b5a5941)Observed behavior
After an RDMA link flap (handled correctly by the #3604
evictAllpath), a later stall began without any link/verbs event. From that point:gdb evidence
Attaching to a vLLM prefill worker process shows 86 threads spinning in
sched_yieldinsideBoundedMPSCQueue<RdmaSliceList, 8192>::push, including all 6 TENT worker threads:The remaining ~80 threads are KV-connector producer threads also stuck in
Workers::submit()→push(). The CQ polling thread stays alive but has nothing to reap (no WRs are ever posted).Root cause
push()is spin-only when the queue is full (bounded_mpsc_queue.h): there is notry_push, no spin budget, no error return.mainthe worker thread callssubmit(slice)from at least three retry paths:asyncPostSend()whengetEndpoint()fails (~workers.cpp:464),push()while re-queueing a retried slice → it never pops again,push()→ no new slice is ever accepted,A bounded queue whose consumer can block on enqueue is a work-conservation violation: one full queue wedges the entire engine.
Suggested fixes
push()a failure exit (e.g.try_push()returningbool, or a bounded spin budget) and propagate it:Workers::submit()failure →updateSliceStatus(slice, FAILED)so transfers fail fast and surface errors instead of wedging.Related
submit blocked, pending never drainssymptom reported there matches this mechanismHappy to provide full gdb thread dumps, core stacks from both peers, or help validate a patch.
@github-actions[bot] commented on GitHub (Aug 24, 2026):
Thanks for opening this issue, @ai2open!
226425123A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide