Skip to main content

Fixed: "error CS8031: Async lambda expression converted to a 'Task' returning delegate cannot return a value"

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Wrapping an endpoint's work in strategy.ExecuteAsync gave error CS8031: Async lambda expression converted to a 'Task' returning delegate cannot return a value. The code looks right, and it returns values on purpose. The compiler just can't work out one type for those values, and a small addition tells it.

Fixed: "The configured execution strategy 'MySQLRetryingExecutionStrategy' does not support user-initiated transactions" in EF Core

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

As soon as I wrapped two writes in BeginTransactionAsync, the endpoint failed with The configured execution strategy 'MySQLRetryingExecutionStrategy' does not support user-initiated transactions. The message tells you the method to use, and here's the shape of the code it means.

Fixed: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool" with MySql.Data

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A request that normally takes a millisecond failed after exactly 15 seconds with error connecting: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. MySQL itself was fine and nearly idle. All the app's connections were taken, by requests that were never going to finish.

Fixed: A Request Never Answers When a MySQL Statement Runs Longer Than CommandTimeout (MySql.Data)

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

I set a short CommandTimeout, expecting an error when a statement ran too long. Instead, the request never answered at all. MySQL had finished long ago, and the connection sat idle, out of reach of everything else. If you're on Oracle's MySql.Data, any async statement slower than CommandTimeout can do this, including a default of 30 seconds behind a row lock.

Fixed: EF Core EnableRetryOnFailure Doesn't Retry MySQL Errors with Oracle's MySql.EntityFrameworkCore

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

I had EnableRetryOnFailure turned on, so I assumed a deadlock or a short outage would be retried. With Oracle's MySQL provider, nothing was retried, ever, and no message says so. The provider asks each error whether it's temporary, and MySqlException always answers no. The fix is one argument.

Fixed: "ERROR 1356 (HY000): View 'sys.innodb_lock_waits' references invalid table(s) or column(s) or function(s)" in MySQL

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Reading sys.innodb_lock_waits failed with ERROR 1356 (HY000): View 'sys.innodb_lock_waits' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them. The view isn't broken. The end of that long message is the real reason: the account lacks a right.