mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

There are no objects available and the waitQueue is full #203

Open linusnorton opened 7 years ago

linusnorton commented 7 years ago

I'm getting this error: There are no objects available and the waitQueue is full in a long running script I have.

What are the reasons for it?

How can I avoid it?

likern commented 7 years ago

@linusnorton Have you found solution for this?

linusnorton commented 7 years ago

No, I was unable to work out the cause or a fix.

mauricio commented 7 years ago

The cause is most likely not giving connections back to the pool, so you either need a larger pool or close the connections.

epifab commented 6 years ago

I bumped into this issue as well. I was initially tempted to raise the queue limits again, but it doesn't sound like an acceptable solution as I can't predict how many queries I will be running simultaneously, and any number is potentially inadequate. I was kind of hoping for some sort of backpressure mechanism that would block or slow down my requests and prevent this runtime exception. Unless I am missing something obvious here, I am not sure what to do at this point, apart from (sadly) abandoning the idea to use this library.

oshai commented 5 years ago

We have fixed this issue in jasync fork of the lib. see this issue: https://github.com/jasync-sql/jasync-sql/issues/41