Connections: Move all AuthenticateAsClient to async by NickCraver · Pull Request #2878 · StackExchange/StackExchange.Redis

added 2 commits

May 3, 2025 11:10
Previously when supporting earlier versions of .NET Framework, we did not have an async version of `AuthenticateAsClient` due to socket itself not having async handlers in earlier versions of `netstandard`. These days though, this can be fully async to prevent thread starvation specifically in the case where we're able to connect a socket but the server is overwhelmed and unable to finish TLS negotiations.

Note that none of these take a cancellation token, so while we can avoid thread growth on the client side as a primary symptom of the case here, the server-side impact of backlogged but unconnected things may continue to grow. It's net better overall, though, and should help a bit on mass connection cases for some applications as well, in the cases TLS negotiation isn't instant.

philon-msft

mgravell

@NickCraver NickCraver deleted the user/craver/async-authenticate-as-client branch

May 3, 2025 18:19