Description:
Two critical issues exist in MySQL.EntityFrameworkCore:
The driver does not honor configured SQL command timeouts (e.g., 30 seconds). Operations hang indefinitely instead of throwing a timeout exception.
When a transaction holds a lock for about 70+ seconds, any concurrent transaction waiting for that lock becomes permanently stuck. The waiting transaction never proceeds, times out, or releases its connection—leaving it in an unrecoverable state.
How to repeat:
Configure an EF Core application with MySQL.EntityFrameworkCore and set command timeout to 30 seconds.
Create two concurrent transactions: Transaction A updates a record and holds the lock for 75+ seconds; Transaction B attempts to update the same record.
Observe that Transaction B neither times out after 30 seconds nor proceeds after Transaction A releases the lock, instead becoming permanently stuck.
Verify the connection remains stuck using SHOW PROCESSLIST; and note that timeout configurations are ignored.
A complete reproduction demo is available at: https://github.com/zhangzw218/MySql.EntityFrameworkCore.Deadlock.Timeout.Demo