Repository navigation
[Bugfix][TENT] Preserve ownership after failed memory free - #3582
Merged
alogfans merged 2 commits intoSep 1, 2026
Merged
Conversation
982945902
requested review from
00fish0,
alogfans,
chestnut-Q,
doujiang24,
dtcccc and
staryxchen
as code owners
August 21, 2026 10:35
alogfans
reviewed
Aug 25, 2026
| ++it) { | ||
| if (it->addr == addr) { | ||
| auto status = it->transport->freeLocalMemory(addr, it->size); | ||
| if (!status.ok()) return status; |
Collaborator
There was a problem hiding this comment.
Advise to prints warning.
Contributor
Author
There was a problem hiding this comment.
Added a warning before returning the transport error. It includes the address, allocation size, and original status while preserving the ownership entry for a later retry. Fixed in ce87244.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
TransferEngineImpl::freeLocalMemory()removed an allocation fromallocated_memory_even when the owning transport returned an error. The memory could remain allocated while the engine permanently lost the ownership record, so callers could not retry the release.This change commits the ownership removal only after the transport reports a successful free. A fail-once transport regression test verifies that the first error preserves the allocation, the second call reaches the transport and succeeds, and a later call is correctly rejected after ownership has been released.
Module
mooncake-transfer-engine)Type of Change
How Has This Been Tested?
Test commands:
Test results:
Address region not registered; the regression test now observes two transport free calls and a successful retry.Checklist
./scripts/code_format.shpre-commitis not installed in the available development image;git diff --checkand the PR-scoped C++ formatting script pass.AI Assistance Disclosure
Codex helped identify and reproduce the ownership-loss path, implement the success-only ownership commit, and add the fail-once regression test. The human submitter should review and understand every changed line before merge.