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
Socket async cancellation and timeout during connection #2860
Comments
@vonzshik another timeout-related issue just in case you're interested :) |
@roji while I don't mind taking this one, it might take a little more effort than just setting the timeout for the connection, as we're also missing it for the authentication part. But I'll do my best to get it done for the 5.0 release. |
No problem @vonzshik! I'll clear the assignee, if you see you're not getting around to it for 5.0, I can try to work on it too. Let's see later. |
Note: thanks to dotnet/runtime#40750, we can do both cancellation and timeout (via cancellation) in Socket.ConnectAsync. |
Woohoo! |
Also enables the code analysis rule for flowing cancellation tokens (part of npgsql#3162). Fixes npgsql#2860
The connector's Connect method doesn't set the socket timeout, so if there's a network failure right during connection we may end up blocking forever.
Take this opportunity to also look at the async path, and to make sure the connection timeout is enforced there as well.
The text was updated successfully, but these errors were encountered: