-
Notifications
You must be signed in to change notification settings - Fork 758
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
[Bug]: Transaction panics in endTransaction
with "transaction not found"
#41281
Comments
Any updates on this issue? Because the transaction just ends with a panic this bug can result in unexpected crashes. The panics are also hard to trap as you essentially need to trap the call to the function that creates the transaction, which is not convenient if the transaction is directly inside a service function. |
Hi @buehlefs, |
This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now. |
I am still able to reproduce a transaction not found error in Ballerina 2201.8.5 (Swan Lake Update 8):
The error seems to be much less likely to occur but is apparently not fixed entirely. I am able to trigger it relatively reliable with a single scheduled task with a ridiculously low interval of 0.001 (when all transactions commit normally). If more tasks scheduled the error can still occur, but the connection pool is more likely to exhaust (see #42242) before that happens. |
Hi @buehlefs, The bug has already been addressed. The decreased occurrence might be due to this partial fix rolled out with 2201.8.5. Unfortunately, this fix wasn't rolled out with version 2201.8.5. It will be included in the upcoming releases: 2201.8.6 and 2201.9.0. As per the issues #42241 and #42242, we will investigate them soon. Thank you for bringing them to our attention! |
Description
Transactions can panic in
endTransaction
when many transactions are invoked from multiple threads concurrently.Steps to Reproduce
Perform many transactions rapidly from multiple threads (e.g. using scheduled tasks)
Minimal code example (click to expand)
The sqlite DB contains a single table "hello" with a string column "world".
Stacktrace:
If
simulateError=true
the stacktrace is often different:Another possibly related stacktrace (from a different program):
The errors seem to suggest that
initiatedTransactions
is not handled threadsafe everywhere.Affected Version(s)
Ballerina 2201.7.2 (Swan Lake Update 7)
OS, DB, other environment details and versions
OS: Ubuntu 20.04 running inside WSL2
JDBC Connector used:
Related area
-> Runtime
Related issue(s) (optional)
Originally reported as https://github.com/ballerina-platform/module-ballerinai-transaction/issues/524, resubmitting here as the issue got no attention.
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response
The text was updated successfully, but these errors were encountered: