-
Notifications
You must be signed in to change notification settings - Fork 333
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
OpenAsync throws "System.Net.Sockets.SocketException: Broken pipe" #150
Comments
@alanprot I think you're right about Are your connections to your MySQL Server NAT'd? I'm trying to write a test case for this, but can't figure out a good way to emulate a NAT timeout. |
Why are you thinking it is caused by a NAT timeout? This is happening in my dev environment and I think it occurs when the server spends some time without serving any requests (idle)... My MySql server is not behind a NAT. |
Broken pipe typically occurs either when you either unplug a network cable or encounter a NAT timeout. This happens because the server has closed the connection and sent a TCP Since the client still thinks the connection is open, it continues the TCP conversation with the server from where it left off. The server has closed the connection already though, so it sends a It's most likely NAT timeout or your network is going away and then coming back. |
Understood. But the applications and mysql servers are inside the same network (AWS VPC) using only internal ips. |
Please try 0.9.1 to confirm whether this is fixed for you. |
Ok ... I'll do it now and let you know if it happens again. Thanks! |
it happens again, during the last several versions
|
we do not use nat, but physical host with static ip , the latest version does not fix too mysql conn string is "MySQL": {
"ReadWriteURI": "server=XXXXXX;port=3306;user=XXXXX;password=XXXXX;database=XXXXX",
"ReadOnlyURI": "server=YYYYY;port=3306;user=YYYY;password=YYYY;database=YYYY;DefaultCommandTimeout=188;SslMode=None;MaximumPoolsize=1588;MinimumPoolSize=8;ConnectionReset=false;ConnectionIdlePingTime=2;ConnectionIdleTimeout=88"
}, |
Sometimes i'm receiving SocketException when calling _con.OpenAsync(cancellationToken).
Follow the stack:
Maybe
await SendAsync(PingPayload.Create(), ioBehavior, cancellationToken).ConfigureAwait(false)
; should be inside try catch to?https://github.com/mysql-net/MySqlConnector/blob/master/src/MySqlConnector/Serialization/MySqlSession.cs#L141
The text was updated successfully, but these errors were encountered: