Skip to content

fix: fix transaction manager race condition - #27669

Merged
jacek-prisma merged 3 commits into
mainfrom
fix/fix-transaction-manager-race-condition
Jul 16, 2025
Merged

jacek-prisma merged 3 commits into
mainfrom
fix/fix-transaction-manager-race-condition

Conversation

@jacek-prisma

@jacek-prisma jacek-prisma commented Jul 16, 2025 •

Copy link
Copy Markdown
Contributor

Should fix #27660

The changes here ensure that we never have a closed transaction inside of this.transactions in between any await points, so users don't end up seeing TransactionInternalConsistencyErrors.
Also adds a closing state that ensures we do not attempt to rollback multiple times.

@github-actions

github-actions Bot commented Jul 16, 2025 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
packages/client/runtime/library.js 404.25 KB (0%)
packages/client/runtime/library.d.ts 81 B (0%)
packages/client/runtime/binary.js 1.27 MB (0%)
packages/client/runtime/binary.d.ts 26 B (0%)
packages/client/runtime/edge.js 339.41 KB (-0.01% 🔽)
packages/client/runtime/edge-esm.js 338.05 KB (-0.01% 🔽)
packages/client/runtime/wasm-engine-edge.js 283.74 KB (0%)
packages/client/runtime/index-browser.js 67.74 KB (0%)
packages/client/runtime/index-browser.d.ts 89 B (0%)
packages/cli/build/index.js 2.79 MB (0%)
packages/client/prisma-client-0.0.0.tgz 12.67 MB (+0.01% 🔺)
packages/cli/prisma-0.0.0.tgz 16.5 MB (+0.01% 🔺)
packages/bundle-size/da-workers-libsql/output.tgz 940.13 KB (0%)
packages/bundle-size/da-workers-neon/output.tgz 1016.97 KB (0%)
packages/bundle-size/da-workers-pg/output.tgz 1023.41 KB (0%)
packages/bundle-size/da-workers-planetscale/output.tgz 961.49 KB (0%)
packages/bundle-size/da-workers-d1/output.tgz 924.41 KB (0%)

@aqrln aqrln left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nit

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 16, 2025
@aqrln aqrln added this to the 6.13.0 milestone Jul 16, 2025
…ionManager.ts

Co-authored-by: Oleksii (Alexey) Orlenko <[email protected]>
@jacek-prisma
jacek-prisma merged commit d641402 into main Jul 16, 2025
@jacek-prisma
jacek-prisma deleted the fix/fix-transaction-manager-race-condition branch July 16, 2025 18:56
@AjaniBilby

Copy link
Copy Markdown

I don't see a git tag for 6.12.1, did this merge make it into that update?
Or is this fix not published to npm yet?

Because I'm having this issue in production - and I'm trying to work out if I just need to get this patch into my system, or if possibly it's a new issue I need to investigate.

@AjaniBilby

Copy link
Copy Markdown

Sorry, never mind, there is no 6.12.1 - idk what I was thinking of.

@jacek-prisma

Copy link
Copy Markdown
Contributor Author

@AjaniBilby it's currently fixed on dev, a new stable version with the fix will release next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transaction API Error: "Closed transaction found in active transactions map" with Query Compiler and Driver Adapter

3 participants