-
Notifications
You must be signed in to change notification settings - Fork 13
Transaction can cause timeout, lost server connection, and connection pool saturation on SQL Server #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We will need to analyze the operation complexity and find a more efficient way of doing bulk deletes |
Looking at the "Average time" metrics, it is clear that the database queries themselves are quite simple and performant, ranging from 31ms to 400ms to execute. But, looking at the "Max time among all execution", we're seeing some discrepancy. Some of these operations suddenly needs 5-6 seconds to execute, this suggests a table/row deadlock that stops the query execution entirely. |
So the error occurred here: Akka.Persistence.Sql/src/Akka.Persistence.Sql/Extensions/ConnectionFactoryExtensions.cs Lines 35 to 46 in 50c585d
We're missing the second inner exception, but the first one indicates to me that the transaction got disposed when it shouldn't have somehow. |
looks like the transaction got hosed even before we tried to commit |
This is the zombie check that @Arkatufus noted in his logs: |
Linq2Db transaction comitting code: Linq2Db transaction opening code: This is where a second transaction can open on the same connection, aborting the original one in-progress |
Probable cause Previous theory that this is caused by backpressure problem, we might be applying query limiter/throttler to the wrong database query that it throttles recovery. This is proven to be impossible, both Static code analysis: |
Current
|
Fix attempt, optimize code:
|
Note It would be great to be able to profile the server itself and actually see the occurence of these table deadlocks. Does anyone know of any tools that can help with this? |
Note Currently,
|
Version Information
Version of Akka.Persistence.Sql? dev branch
TimeoutException
during persistenceHandleDeleteMessagesTo
execution #528 and Exception when deleting messages:SqlTransaction has completed; it is no longer usable
#527CancellationToken
API changes (v1.5.42) integration test #535 might helpDescribe the bug
Transaction can cause timeout, zombie connection, and/or connection pool exhaustion on SQL Server during persistence
HandleDeleteMessagesTo
execution with high persistence activity. This seems to be caused by table/row lock and the complexity of the operation.The text was updated successfully, but these errors were encountered: