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
qe: improve error messages for closed transactions #3391
Conversation
8eb3e1d
to
a0f321d
Compare
d97372b
to
a3aebd9
Compare
Some tests fail because they expect a different error message. Other than that, the changes look correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, great job ✅
In production I get
And it's a useless error message and going straight into my logs, I have no context here. |
The lack of |
Please open an issue over at https://github.com/prisma/prisma instead of commenting on a 11 months old, merged PR. Thank you. |
Make the error messages for closed transactions more detailed, add extra context about the transaction timeout.
Before:
Transaction API error: Transaction already closed: A query/commit/rollback cannot be executed on a closed transaction..
(also note the double "." at the end)
Now:
Transaction API error: Transaction already closed: A query/commit/rollback cannot be executed on a committed transaction.
Transaction API error: Transaction already closed: A query/commit/rollback cannot be executed on a transaction that was rolled back.
Transaction API error: Transaction already closed: A query/commit/rollback cannot be executed on an expired transaction. The timeout for this transaction was X ms, however Y ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.
Additionally, the "Transaction not found error" is now also more verbose, ref: https://www.notion.so/disconnect-with-iTX-f3cfee3ff4924e40aa90aadb2454e9fa?d=3bd7c7103b02461bbfe414a978a994c1#547ab127682b41898c87bdd5c841c0bf
This PR also contains minor cleanup things related to iTX I did along the way, I'm happy to move them to separate tiny PRs to reduce scope of this PR if you'd like:
CachedTx::Aborted
variant.envrc
Client PR: prisma/prisma#16382
Closes: prisma/prisma#13713
Ref: prisma/prisma#16050
Ref: #3028