[Blockstore] Close split local sglist before replying on error#6345
Open
EvgeniyKozev wants to merge 3 commits into
Open
[Blockstore] Close split local sglist before replying on error#6345EvgeniyKozev wants to merge 3 commits into
EvgeniyKozev wants to merge 3 commits into
Conversation
Contributor
|
Note This is an automated comment that will be appended during run. Note All workloads for linux-x86_64-relwithdebinfo have completed. Tip Planned checks for linux-x86_64-relwithdebinfo. 🟢 linux-x86_64-relwithdebinfo target: cloud/blockstore/ (test time: 1088s): all tests PASSED for commit fcef562.
|
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.
Problem
TCompositeRequest::OnSubResponse()completed the parent promise before closing the parentTGuardedSgListwhen a local subrequest failed.NThreading::TPromise::SetValue()invokes subscribed callbacks synchronously. A callback can therefore move the originalTWriteBlocksLocalRequestwhileOnSubResponse()is still on the stack. The followingRequest->Sglist.Close()then runs on a moved-fromTGuardedSgListand aborts onY_ABORT_UNLESS(GuardedObject).Fix
Close the parent local sglist before completing the parent promise. This cancels sibling subrequests before any user-visible callback can run or move the original request.
Regression test
Added
TSplitRequestServiceReentrantTest::ShouldCloseLocalSglistBeforeCompletingOnSubRequestError.The test:
WriteBlocksLocalrequest into two subrequests;Before the fix, the test aborts in
TGuardedSgList::Close(). With the new ordering, it completes withE_REJECTED.Testing
Not run locally because this environment does not contain an NBS checkout/build toolchain. The focused CI command is:
./ya make -tt cloud/blockstore/libs/service/ut \ -F TSplitRequestServiceReentrantTest::ShouldCloseLocalSglistBeforeCompletingOnSubRequestError