Open Holbanner opened 2 months ago
Hey @Holbanner, would you mind sharing with us a reproduction repository with detailed steps to observe your error? That'd be extremely helpful. Thank you
Can confirm this, running on v4.3.1 though. Thought that upgrading would help but apparently the problem still the same. One thing I noticed is that there're alot of COMMIT queries usually never gets terminated.
Hey @Holbanner, would you mind sharing with us a reproduction repository with detailed steps to observe your error? That'd be extremely helpful. Thank you
I would very much like to, but that's one of those issues that "work on my machine". I'm only facing this issue on my staging environment.
This problem is evolving somehow in weird ways.
I've tried playing around with pool_timeout and connection_pool and see the changes in the error. (to the extend that it displays whatever i have changed)
By slightly changing how the code runs, i've come to understand that the problem is not only this particular request but most of the requests using the model MarketsGameInstances
From what i've gathered a first request fails then the serve closes connection somehow creating the deadlock (with Server has closed the connection
errors looping)
I'm currently investigating the model, but the only thing that sets it appart is that OfferType is an enum
Bug description
While using Prisma and pg-bouncer via cloudnativePg, we configured our connection to use pgbouncer by passing the
?pgbouncer=true
parameter to the connection urlWe have jobs running periodically, one of which runs an updateMany() on multiple rows based on dates. Around the time the day changes, this job logically sees a peak in activity. There can be multiple instances of this job running concurrently
When this happens we start to see this connection limits errors coming from prisma :
Timed out fetching a new connection from the connection pool. More info: http://pris.ly/d/connection-pool (Current connection pool timeout: 10, connection limit: 9)
While pgbouncer seems to be running normallyWe've also notice Prisma throwing an error containing the following chunk of the client runtime library before the first timeout of the daily run (that's line 122 from prisma/client/library.js) :
How to reproduce
Set up Prisma to use pgbouncer Run a large amount of queries in parallel
Expected behavior
We expect prisma to let pgbouncer handle the connection pooling
Prisma information
Environment & setup
Prisma Version