OpenTcpSocketAsync/GetHostAddressesAsync: use new cancellation token overloads#3
OpenTcpSocketAsync/GetHostAddressesAsync: use new cancellation token overloads#3gboucher90 wants to merge 3 commits intomemsql:masterfrom
Conversation
| #if NET6_0_OR_GREATER | ||
| ? await Dns.GetHostAddressesAsync(hostName, cancellationToken).ConfigureAwait(false) | ||
| #else | ||
| ? await Dns.GetHostAddressesAsync(hostName).ConfigureAwait(false) | ||
| #endif |
There was a problem hiding this comment.
This is already on Master for original MySqlConnector https://github.com/mysql-net/MySqlConnector/blob/master/src/MySqlConnector/Core/ServerSession.cs#L1036
Not sure if you would like to resync the SingleStore fork as part of another change maybe? In particular to include this change mysql-net@5a83331
| #if NET5_0_OR_GREATER | ||
| await tcpClient.ConnectAsync(ipAddress, cs.Port, cancellationToken).ConfigureAwait(false); | ||
| #else | ||
| await tcpClient.ConnectAsync(ipAddress, cs.Port).ConfigureAwait(false); | ||
| #endif |
There was a problem hiding this comment.
Suggesting this change on original MySqlConnector here mysql-net#1291
|
Hey @okramarenko Any reason to close this PR given it was merged in the official SqlConnector? Thank you! |
|
hi @gboucher90! these changes are already pulled from the official MySqlConnector |
Ah okay perfect, thank you :) |
There is a cancellable variant introduced in .Net 5.0:
https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient.connectasync?view=net-5.0#system-net-sockets-tcpclient-connectasync(system-string-system-int32-system-threading-cancellationtoken)
We are observing issue where the cancellation doesn't take effect properly. In particular suspecting this could be the issue described here dotnet/runtime#17611