mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #446] [TransferEngine] Incorrect Error Handling in TransferEngine::allocateBatchID #154
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#154
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 @chenhao-ye on GitHub (Jun 3, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/446
According to the document,
BatchID TransferEngine::allocateBatchID(size_t batch_size)is expected to return a negative value (e.g.,ERR_MEMORY) to indicate the failure. However,BatchIDis unsigned (uint64_t) and actually carries a pointer toBatchDesc, so there is no way to indicate failure. In the case of failure, an error code is cast into a BatchDesc pointer and dereferenced, which can cause a segfault.One potential fix is to avoid using a pointer as
BatchID, but manage all allocatedBatchDescin a vector/map and return the index/key inside the vector/map asBatchID. This also eases the cleaning onTransferEnginedestructor, which can track which batches have not been freed yet and manually do it.@alogfans commented on GitHub (Jun 12, 2025):
Currently we require the user to check the validity of returned batched id before using it. In our next version we will change the API to fix this problem (i.e. return both
statusandbatch_id).@chenhao-ye commented on GitHub (Jun 12, 2025):
What would be the recommended way to check the validity of the batch id? Since it is unsigned, it will never be negative.
@alogfans commented on GitHub (Jun 17, 2025):
We have updated code, so that the batch id is guaranteed positive. The only error in
BatchIDallocation is out-of-memory.@github-actions[bot] commented on GitHub (Jul 8, 2026):
This issue has had no activity for 90 days and will be closed in 7 days if there is no further activity. Please comment or react if it should stay open.
@github-actions[bot] commented on GitHub (Jul 16, 2026):
Closing due to 3 months of inactivity. If this is still relevant, please comment and we can reopen.