Skip to content

alts: Apply a single timeout to the entire ALTS handshake - #13189

Open
JoeCqupt wants to merge 1 commit into
grpc:masterfrom
JoeCqupt:feat/alts-handshake-timeout-13172
Open

JoeCqupt wants to merge 1 commit into
grpc:masterfrom
JoeCqupt:feat/alts-handshake-timeout-13172

Conversation

@JoeCqupt

Copy link
Copy Markdown
Contributor

An ALTS connection can stall while waiting for a handshake permit or for the peer to send its next frame. The existing 20-second deadline on the handshaker RPC does not close the connection in either case.

Start a 20-second deadline before requesting a permit and pass that same deadline to the handshaker RPC. If the handshake times out, report UNAVAILABLE so the transport closes the connection. When the handshake handler is removed, cancel the timer and either remove the pending permit request or return the acquired permit.

Fixes #13172

Start the handshake deadline before requesting a permit so a connection
cannot wait indefinitely in the queue or for the peer to respond.
Pass the same deadline to the handshaker RPC so time spent waiting for
a permit counts toward the existing 20-second budget.

Close the connection on timeout and cancel any queued permit request
when the handshake handler is removed.

Fixes grpc#13172

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

alts: Set timeout for semaphore acquire during ALTS handshake

1 participant