mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #3890] [Bug][TransferEngine] Failed notify batches retain stale notification state #993
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#993
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 @CorgiBoyG on GitHub (Sep 6, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/3890
Bug Report
Description
Classic Transfer Engine keeps notify metadata after a failed transfer batch is successfully freed.
TransferEngineImpl::submitTransferWithNotify()stores the target andNotifyDescinnotifies_to_send_, keyed byBatchID.getBatchTransferStatus()erases that entry only when the whole batch reachesCOMPLETED. OnFAILEDorTIMEOUT, callers can later release the batch throughfreeBatchID(), but that method only delegates toMultiTransport::freeBatchID().MultiTransport::freeBatchID()deletes the underlyingBatchDesc, while thenotifies_to_send_entry remains alive with the same pointer-derived key and its notification strings.Runtime path
The Python synchronous transfer paths exercise this lifecycle:
The same side table is shared by the multi-protocol notify submission path.
Impact
The immediate deterministic impact is lifetime retention: each failed notify batch can retain an
unordered_mapnode, target ID, notification name, and arbitrary notification payload until the engine is destroyed.There is also an ABA correctness risk because
BatchIDis the integer representation of the allocatedBatchDesc*. If the allocator later reuses that address for a different non-notify batch, a successful status query for the new batch can find the stale entry and send the old notification for unrelated data.Expected behavior
When
freeBatchID()successfully releases a batch, it should also remove any pending notification associated with that batch. A failedfreeBatchID()(for example,BatchBusy) must keep the notification because the batch is still live and may later complete successfully.Reproduction
A deterministic unit test can use the existing
TransferEngineImplTestPeerand fake transports inmooncake-transfer-engine/tests/transport_uint_test.cpp:FAILED.FAILED.freeBatchID(batch_id).Current behavior leaves one entry after step 3. The expected count is zero. A companion case should verify that
BatchBusyleaves the entry intact.Relevant code
mooncake-transfer-engine/include/transfer_engine_impl.hsubmitTransferWithNotify()mp_submitTransferWithNotify()freeBatchID()getBatchTransferStatus()mooncake-transfer-engine/src/multi_transport.cppallocateBatchID()freeBatchID()getBatchTransferStatus()mooncake-integration/transfer_engine/transfer_engine_py.cpptransferSync()batchTransferSync()I plan to add hardware-independent regression coverage for both successful release and
BatchBusy, then makeTransferEngineImpl::freeBatchID()erase the side-table entry only after the underlying batch is actually freed. I expect to have a reviewed implementation ready within one day.This issue was identified with AI assistance; the contributor independently traced the current
upstream/maincall path and collision-checked existing issues and pull requests.@github-actions[bot] commented on GitHub (Sep 6, 2026):
Thanks for opening this issue, @CorgiBoyG!
111257566A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide