mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #3459] [Bug][TENT] RuntimeQueueDispatch.DispatchesOnlyOneWindowOnSubmit races with ProgressWorker #887
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#887
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 @staryxchen on GitHub (Aug 16, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/3459
Bug Report
Environment
kvcache-ai/Mooncaketent-ci (cuda-off)(run 31924225931)
tent_runtime_queue_dispatch_testRuntimeQueueDispatch.DispatchesOnlyOneWindowOnSubmitThis is an intermittent unit-test race, not a production RDMA failure. It does not require a GPU or a real NIC.
Description
DispatchesOnlyOneWindowOnSubmitasserts that a runtime-queue submit withmax_dispatch_owners=1dispatches only the first owner before the test thread polls:That assertion is racing the background
ProgressWorker.When
enable_runtime_queueis true,TransferEngineImplalso forcesenable_progress_worker_=true.submitTransferthen:refillDispatchWindow()— dispatches owner 0notifyRuntimeQueueReady()— wakesProgressWorkerThe test's
FakeTransportwritesCOMPLETEDinto the fake sub-batch at submit time (nopoll_status_factory). If the worker runsprogressRuntimeQueue()before theEXPECT_EQ, it observes owner 0 as terminal, releases the window, and immediately dispatches owner 1. The test then seessubmit_calls == 2.The sibling test
KeepsDispatchWindowUntilOwnerIsTerminalis the intended coverage for “do not refill until the owner is terminal”: it keeps the first ownerPENDINGuntil the test flips a flag, and it passed in the same failing job.Why this does not show up on every PR
Two independent filters:
Most PRs never run this test.
tent-ciis path-filtered tomooncake-transfer-engine/**,mooncake-common/**, top-level CMake/dependencies.sh/ci.yml. Store-only PRs skip the job. Even whentent-ciruns, onlycuda-off/cuda-off-metrics-on/ub-mockexecute TENT tests;cuda-onis build-only.When the test does run, the assertion is timing-dependent. Same branch, same test binary:
tent-ci (cuda-off)submit_callsis 2, expected 1In the failing run,
tent-ci (cuda-off-metrics-on)and Debugtent-ci (ub-mock)still passed 36/36. A metrics or Debug build changes scheduling enough for the assertion to win.This is a flake in the test's synchronization, not a deterministic dispatch-window regression.
Evidence from the failing job
KeepsDispatchWindowUntilOwnerIsTerminalpassed in that same job.Steps to reproduce
USE_CUDA=OFF(Release / RelWithDebInfo, same astent-ci (cuda-off)).submit_calls == 2. A single passing run does not mean the race is gone.Expected behavior
The test should check that submit admission only fills one dispatch slot while the first owner is still in-flight. That requires the first fake task to stay non-terminal until the test explicitly completes it (same pattern as
KeepsDispatchWindowUntilOwnerIsTerminal).It should not assert “the progress worker has not run yet”.
Suggested fix
In
DispatchesOnlyOneWindowOnSubmit, giveFakeTransportaPENDINGpoll factory until after thesubmit_calls == 1check, then complete owner 0 and expect the second submit. Do not change runtime-queue dispatch logic for this failure.Alternatively, disable the progress worker for this one test if the goal is strictly to unit-test
refillDispatchWindow()on the submit path. Keeping the ownerPENDINGis the smaller, more realistic change.Before submitting
auditwheel/patchelfCI failures on the same PR@github-actions[bot] commented on GitHub (Aug 16, 2026):
Thanks for opening this issue, @staryxchen!
151037142A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide