System.Data.SqlClient 4.8.2 throws TransactionAbortedException (the connection has been broken) #729
Description
Description
After updating System.Data.SqlClient version from old 4.6.1 to latest 4.8.2 we started to see period errors like this:
System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.InvalidOperationException: The requested operation cannot be completed because the connection has been broken.
--- End of inner exception stack trace ---
at System.Transactions.TransactionStateAborted.EndCommit(InternalTransaction tx)
at System.Transactions.CommittableTransaction.Commit()
at System.Transactions.TransactionScope.InternalDispose()
at System.Transactions.TransactionScope.Dispose()
...
Those exceptions happening in pure ADO.NET code with TransactionScope created with ReadCommitted isolation level, TransactionScopeOption.Required, 1 minute timeout and TransactionScopeAsyncFlowOption.Enabled.
After rolling back to System.Data.SqlClient 4.8.1 those exceptions dissapeared but we saw another new type of exceptions we've never seen before from cassandra driver:
Exception while trying borrow a connection from a pool
System.Net.Sockets.SocketException: Transport endpoint is not connected
at Cassandra.Connections.HostConnectionPool.GetExistingConnections()
at Cassandra.Connections.HostConnectionPool.BorrowExistingConnection()
at async Cassandra.Connections.HostConnectionPool.GetConnectionFromHostAsync(?)
Downgrading back to 4.6.1 seems to fixed all issues.
Configuration
It happened on aspnet core 3.1 web applications and console netcore 3.1 applications with latest 3.1 images both running in container on Linux.
Regression?
It works on System.Data.SqlClient 4.6.1
Other information
This issue happening on heavy load application and only on production. I can't reproduce this issue locally.
I wish I could find source for System.Data.SqlClient library to see the diff for 4.8.2 version.
Activity