I DID respond with more details.
.NET -> MySql random connection issues
Random, and rarely, our .NET app running on Azure gets connection errors as follows.
We're running MySql 5.7 ( yes, we know ... )
FYI, the app has almost no error handling, and no logging.
We inherited this app.
Here is the error returned from Application Insights, as stated all errors seem to be from READs:
Fatal error encountered during command execution. Fatal error encountered attempting to read the resultset. Reading from the stream has failed. Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
The data access for the entire app is THE most basic.
Razor pages with embedded SQL, and here is the entire DA code:
using Dapper;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataLibrary
{
public class DataAccess : IDataAccess
{
public async Task<List<T>> LoadData<T, U>(string sql, U parameters, string connectionString)
{
using (IDbConnection connection = new MySqlConnection(connectionString))
{
var results = await connection.QueryAsync<T>(sql, parameters);
return results.ToList();
}
}
public Task SaveData<T>(string sql, T parameters, string connectionString)
{
using (IDbConnection connection = new MySqlConnection(connectionString))
{
return connection.ExecuteAsync(sql, parameters);
}
}
}
}