Fix late selective_channel retry after EndRPC#3359
Open
hjwsm1989 wants to merge 1 commit into
Open
Conversation
Ignore late selective_channel SubDone callbacks once the main RPC enters EndRPC, and keep a defensive balancer null check in Sender::IssueRPC. Add a regression test covering timeout plus delayed sub-call completion.
c2c7d03 to
e27a7e9
Compare
Contributor
Author
|
@chenBright hello, please help review |
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.
What problem does this PR solve?
Issue Number: #3358
Problem Summary:
This fixes a
selective_channelrace where a lateSubDone::Run()may re-enterretry/backup after the main RPC has already entered
EndRPC().The crash report in #3358 shows that a late sub-call callback can still flow into:
Controller::OnVersionedRPCReturned()Controller::IssueRPC()schan::Sender::IssueRPC()after the main controller has already started tearing down its state.
That leaves
selective_channelvulnerable to retrying on partially torn-downstate, including the previously observed null balancer path.
What is changed and the side effects?
Changed:
EndRPC()SubDonecallbacks once the main RPC is already endingschan::Sender::IssueRPC()This keeps the retry/backup state machine from re-entering after teardown has
started, and also preserves a hard guard at the
selective_channelboundary.Test:
Added a regression test that:
SelectiveChannelThis reproduces the late callback window and verifies it no longer re-enters
retry/backup after timeout.
Also re-ran related selective/backup request tests.
Side effects:
Performance effects:
Breaking backward compatibility:
Check List: