Skip to content

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

Merged
easwars merged 8 commits intogrpc:masterfrom
matthewstevenson88:alts-max-concurrent-streams-fix
Mar 17, 2023
Merged

credentials/alts: defer ALTS stream creation until handshake time#6077
easwars merged 8 commits intogrpc:masterfrom
matthewstevenson88:alts-max-concurrent-streams-fix

Conversation

@matthewstevenson88
Copy link
Copy Markdown
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
Comment thread credentials/alts/internal/handshaker/handshaker.go Outdated
@matthewstevenson88
Copy link
Copy Markdown
Contributor Author

cc: @apolcyn

@matthewstevenson88
Copy link
Copy Markdown
Contributor Author

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

Comment thread credentials/alts/internal/handshaker/handshaker.go
Comment thread credentials/alts/internal/handshaker/handshaker.go
Comment thread credentials/alts/internal/handshaker/handshaker.go
Comment thread credentials/alts/internal/handshaker/handshaker.go Outdated
Comment thread credentials/alts/internal/handshaker/handshaker.go Outdated
Comment thread credentials/alts/internal/handshaker/handshaker.go
Comment thread credentials/alts/internal/handshaker/handshaker.go Outdated
Comment thread credentials/alts/internal/handshaker/handshaker_test.go Outdated
@easwars
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
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 <[email protected]>
@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.

5 participants