mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #2432] [Py] batch_transfer_async / transfer_submit_write return -1 through uint64 batch_id_t — documented failure sentinel 0 never fires, callers crash #648
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#648
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 @bp-cheng on GitHub (Jun 11, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/2432
Originally assigned to: @bp-cheng on GitHub.
TransferEnginePy::batchTransferAsyncreturnsbatch_id_t, which isuint64_t(mooncake-transfer-engine/include/transfer_engine_c.h:27). WhenopenSegmentfails it doesreturn -1;(mooncake-integration/transfer_engine/transfer_engine_py.cpp:609), so Python receives18446744073709551615instead of an error:0(lines 618, 651),batch_transfer_async/batch_transfer_async_write/batch_transfer_async_read(docs/source/python-api-reference/transfer-engine.md),assertNotEqual(batch_id, 0, ...)(mooncake-wheel/tests/transfer_engine_initiator_test.py:224).A caller that follows the documented
batch_id != 0check treats the bogus id as valid and passes it toget_batch_transfer_status, whichreinterpret_casts it toBatchDesc*and dereferences it (transfer_engine_py.cpp:667-668) → SIGSEGV.transferSubmitWritehas the same defect twice (lines 733, 748). Its documented contract is "negative value on failure", which auint64_treturn can never satisfy as seen from Python, so failures are undetectable there as well. The line-748 path additionally leaks the freshly allocatedBatchDesc(its siblingsbatchTransferAsync/batchTransferSynccallfreeBatchIDon the equivalent path).Trigger condition is mundane — any
openSegmentfailure (typo'd, unregistered, or down target hostname); no special hardware. Reproduced on current main (474f6785) withtcp+ the HTTP metadata server, Ubuntu 22.04:Fix incoming: normalize the failure return of the three sites to
0(batch ids are heapBatchDesc*values, never 0), free the allocated batch intransferSubmitWritelike its siblings do, and align thetransfer_submit_writedocs ("negative value" → "0").@github-actions[bot] commented on GitHub (Jun 11, 2026):
Thanks for opening this issue, @bp-cheng!
194346132A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide