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
interactiveTransactions rollback but don't error out if timeout is reached #9533
Comments
I can reproduce this. Thanks for the detailed report. |
Can this affect regular (non-interactive) transactions as well? We have enabled Edit: upon second glance, I thought my question might be a bit vague, so let me rephrase it: |
I think this issue is related to another one I opened here: #9584 If the root cause is indeed the same (issue in transaction timeout handling), it should affect regular transactions as well, since in my issue I made an MRE reproducing the error with "regular transactions". |
From what I can see on this. The issue is here
The query-engine will never throw an actual error but will return an error object: {
"is_panic":false,
"message":"Transaction API error: Transaction already closed: Transaction is no longer valid. Last state: 'Expired'.",
"meta":{
"error":"Transaction already closed: Transaction is no longer valid. Last state: 'Expired'."
},
"error_code":"P2028"
} We need to check the response and throw an error if we detect it. We need to do the same for rollback |
PR ready for review here: #10797 |
I think I've also run into this issue. When I turn on
This transaction works without any problems when this preview feature is disabled and its execution usually takes around 30 seconds. I'm using SQLite database. |
Bug description
When using interactive transactions, the transaction returns successfully even if the timeout was reached and internally the transaction was rolled back.
More context here #8664 (comment)
How to reproduce
yarn dev:database
prisma migrate dev
yarn dev
Expected behavior
Transaction that surpasses
timeout
should throw an error rather than returning the return value as if nothing has happened.Prisma information
all included in repro example above
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: