MySqlConnector icon indicating copy to clipboard operation
MySqlConnector copied to clipboard

The connection timeout setting time is inconsistent with the actual timeout time

Open lsczyzkb opened this issue 1 year ago • 0 comments
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 1713855717097

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.

lsczyzkb avatar Apr 23 '24 07:04 lsczyzkb