Fix memory leak in HTTP request security handshake cancellation#28971
Merged
apolcyn merged 3 commits intogrpc:masterfrom Mar 1, 2022
Merged
Fix memory leak in HTTP request security handshake cancellation#28971apolcyn merged 3 commits intogrpc:masterfrom
apolcyn merged 3 commits intogrpc:masterfrom
Conversation
markdroth
approved these changes
Feb 24, 2022
Member
|
Is there any way we can add a test for this? |
Contributor
Author
Outside of finding the right concurrency settings in the test to tickle the race more frequently, we could probably coordinate the race with a mock channel creds. I haven't gotten to that yet but I'll look into that. |
Member
|
You probably don't need a mock channel creds, just a mock handshaker. You can register a handshaker directly without going through channel creds (example). |
Contributor
Author
|
I put together the mock handshake approach, but I realized that the handshake manager also has shutdown logic which needed to be overridden too, in order to trigger the race. I went with a different approach which I think winds up being simpler. PTAL |
Contributor
Author
|
failures are pre-existing |
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.
The caller of the Handshake API, owns output arguments if the handshake completes successfully. So there's currently a potential race where a handshake completion can be scheduled successfully but the HTTP request is cancelled before the completion runs.
b/220992477