High permanent CPU usage after calling $disconnect on a client that executed an interactive transaction before (v3.9.0+) #12516
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: $disconnect
topic: interactiveTransactions
Milestone
Bug description
We often recreate our prisma client in automated tests. After each test, we call
await prismaClient.$disconnect()
. Starting with Prisma v3.9.0 (in Prisma v3.8.0 it works fine), this causes the node process to get very high CPU usage, stacking with each new client that disconnects, up to 100%.After investigating the issue, I observed that this only seems to happen if the client was used to run an interactive transaction before (but it's not necessarily the last query).
How to reproduce
The test script has pauses so you can observe the CPU usage - after "Interactive transaction callback" it's still fine, but as soon as "Disconnected" is displayed, the CPU usage of the node process increases tremendously and will stay on a high level (and will continue to increase as new clients call disconnect).
If you replace the interactive transaction with something different (e.g. a "normal" transaction), then the CPU usage will stay low.
Expected behavior
CPU usage should not skyrocket when disconnecting from a client after running an interactive transaction.
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: