MySqlConnector
MySqlConnector copied to clipboard
The connection timeout setting time is inconsistent with the actual timeout time
trafficstars
Software versions MySqlConnector version:2.2.6 Server type (MySQL, MariaDB, Aurora, etc.) and version: 8.0.34-commercial .NET version: 6.0 (Optional) ORM NuGet packages and versions: SqlSugar 5.1.4.126
Describe the bug The connection timeout setting time is inconsistent with the actual timeout time, Connection timeout setting of 15 seconds, time timeout takes 15 minutes. But at this time, the number of database connections is not high, and the network is also normal.
Exception
Code sample
DateTime st = DateTime.Now;
try
{
this.Connection.Open();
}
catch (Exception ex)
{
var ts = DateTime.Now - st;
Check.Exception(true, ErrorMessage.ConnnectionOpen, ex.Message + $" ConnectionTimeout={this.Connection.ConnectionTimeout};" + $"Use Time {ts}" + $" DbType=\"{this.Context.CurrentConnectionConfig.DbType}\";ConfigId=\"{this.Context.CurrentConnectionConfig.ConfigId}\"");
}
Expected behavior Correct timeout time and provide feasible solutions
Additional context Add any other context about the problem here.