Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

credentials/alts: defer ALTS stream creation until handshake time #6077

Merged

Conversation

matthewstevenson88
Copy link
Contributor

@matthewstevenson88 matthewstevenson88 commented Mar 3, 2023

The existing code creates the stream to the ALTS handshaker service before checking that we are not exceeding the max number of concurrent connections, which defeats the purpose of having the max pending handshakes cap.

While we're here, I also lower the maxPendingHandshakes cap to 40, to match up with the C-core code and with the current expectations of the ALTS handshaker service. (We will be lowering this cap again in the future.)

RELEASE NOTES: none

@arvindbr8 arvindbr8 marked this pull request as ready for review March 3, 2023 05:39
@matthewstevenson88
Copy link
Contributor Author

cc: @apolcyn

@matthewstevenson88
Copy link
Contributor Author

@arvindbr8 I saw you added the "Status: Requires Report Clarification" tag: please let me know what you'd like me to clarify. :)

@easwars
Copy link
Contributor

easwars commented Mar 14, 2023

Also, is the title of the PR up-to-date? I don't any see lock being involved here.

@matthewstevenson88 matthewstevenson88 changed the title Do not create ALTS stream until lock is released. Do not create ALTS stream until acquire() returns true. Mar 14, 2023
@matthewstevenson88
Copy link
Contributor Author

Also, is the title of the PR up-to-date? I don't any see lock being involved here.

The lock is hidden under the call to acquire(). Updated the title to clarify. :)

@matthewstevenson88 matthewstevenson88 requested review from easwars and removed request for arvindbr8 March 16, 2023 16:39
@easwars easwars changed the title Do not create ALTS stream until acquire() returns true. credentials/alts: defer ALTS stream creation until handshake time Mar 16, 2023
@matthewstevenson88
Copy link
Contributor Author

Thanks all for the reviews! @arvindbr8 or @easwars: would one of you be able to merge the PR? I'm afraid I don't have write access. :)

@easwars easwars merged commit c84a500 into grpc:master Mar 17, 2023
10 checks passed
zasweq added a commit to zasweq/grpc-go that referenced this pull request Mar 23, 2023
zasweq added a commit that referenced this pull request Mar 23, 2023
matthewstevenson88 added a commit to matthewstevenson88/grpc-go that referenced this pull request Apr 10, 2023
easwars pushed a commit to easwars/grpc-go that referenced this pull request May 4, 2023
easwars added a commit that referenced this pull request May 5, 2023
Co-authored-by: Zach Reyes <39203661+zasweq@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants