Bug #115937 The request hangs after IO timeout, and trx doesn't release forever
Submitted: 27 Aug 2024 8:40 Modified: 31 Aug 2024 14:00
Reporter: King Chen Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:9.0.0 OS:Any
Assigned to: CPU Architecture:Any

[27 Aug 2024 8:40] King Chen
Description:
asp.net core, .net 8

The request hangs after IO timeout, and trx doesn't release forever

How to repeat:
1. begin transaction, not commit

SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
start transaction;

UPDATE test_table SET data = '2023-12-22T17:14:12+08:00' WHERE Id = 3;

-- ROLLBACK;

2. update the same data

 [HttpGet("/demo")]
 public async Task<string> TestDemo()
 {
     var connStr = Consts.YourConn;

     using (var conn = new MySqlConnection(connStr))
     {
         await conn.OpenAsync();
         using (var transaction = await conn.BeginTransactionAsync())
         {
             try
             {
                 var command = conn.CreateCommand();
                 command.Transaction = transaction;
                 command.CommandText = "UPDATE test_table SET data = 'hangs' WHERE Id = 3;";

                 var affectedRows = await command.ExecuteNonQueryAsync();

                 await transaction.CommitAsync();
                 return affectedRows.ToString();
             }
             catch (Exception ex)
             {
                 await transaction.RollbackAsync();
                 return ex.Message;
             }
         }
     }
 }

3. the request hangs after timeout
[28 Aug 2024 9:14] MySQL Verification Team
Hello King Chen,

Thank you for the bug report and feedback.
Could you please provide a repeatable test case (sample console app in c# which manifest the issue - please make it as private if you prefer) to reproduce this issue at our end? Thank you.

Regards,
Umesh
[30 Aug 2024 9:14] King Chen
demo

Attachment: Test.Console.zip (application/zip, text), 1.57 KiB.

[30 Aug 2024 9:29] MySQL Verification Team
Thank you for the requested details, will get back to you if anything further needed to verify.

regards,
Umesh
[31 Aug 2024 14:00] MySQL Verification Team
Hello King Chen,

Thank you for the report and test case.

regards,
Umesh