Bradley Grainger

Results 478 comments of Bradley Grainger

I work on systems with MySqlConnector 2.3.5 deployed to production and opening about 1,000,000 database connections per hour. We have not seen widespread `NullReferenceException`s like you're reporting. Are you able...

Thanks for the update. That code looks pretty "bog standard", as you said. `CommandFlags.Buffered` is a little unusual (I don't think most Dapper users use it), but shouldn't cause any...

I see you're passing in `cancellationToken: cancellationToken`. Is it possible that these exceptions are correlated with cancelled queries? Do you know how frequently cancellation is happening?

Is anyone who is experiencing this problem able to provide a self-contained example that reproduces the exception?

> Upgraded MySqlConnector from 2.1.11 to 2.3.5 One major change in 2.3.5 was https://github.com/mysql-net/MySqlConnector/issues/1277 which recycles `MySqlDataReader` instances. Having two threads use the same instance at once would be a...

> Is anyone who is experiencing this problem able to provide a self-contained example that reproduces the exception? Another thing that might help is providing trace-level logging leading up to...

I created a test program to issue a large number of simultaneous queries to MySQL Server with Dapper (using `QueryAsync`), using combinations of the following variations: * `mysql:8.3` Docker container...

> I wonder if there's an earlier exception that's being thrown, but this NullReferenceException is coming from a second exception being thrown while finally blocks are being run. I think...

> I think this is what's happening. I was able to reproduce the following two call stacks by deliberately injecting errors into the MySQL protocol being returned to MySqlConnector Further...

Thanks @jayrowe; that's a great test case. I was able to simplify the inner loop down to: ```csharp using var connection = new MySqlConnection(connectionString); connection.Open(); using var command = connection.CreateCommand();...