exhausting the pool
See original GitHub issueHi Brian
To continue our brief communication, here is a code that demonstrates the problem.
The following will exhaust the pool and only two queries will ever be executed (instead of 4), is this normal? am I missing something here?
var pg = require('pg')
var connectionString = 'your connection string here'
pg.defaults.poolSize = 2
var executedCount = 0
function query() {
pg.connect(connectionString, function (err, conn, done) {
conn.query('select 1+1', function (err, results) {
console.log(++executedCount)
done(1) //destroy the connection
})
})
}
console.log('dont let the process exit after two queries')
setTimeout(function() {
console.log('timed out')
}, 10000)
query()
query()
query()
query()
Issue Analytics
- State:
- Created 10 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
'Pool Fatigue' Has Nothing to Do with Overswimming
One of the biggest reasons people call Eagle Pools to arrange for ... And after a while, keeping up with all that work...
Read more >6 Reasons Swimming Makes You Tired (& What To Do About It)
Some possible reasons for feeling tired after swimming include the physiological effect of the water temperature on your body, the strenuous nature of...
Read more >How to Protect Connection Pool from Being Exhausted
How can one protect the JDBC connection pool from being exhausted? Solution. Sign In. To view full details, sign in with your My...
Read more >Water Services Draining and Backwashing Your Pool
When you need to backwash your pool filter or drain the pool, reuse the water to irrigate landscaping. Do not drain water into...
Read more >Thinking of Draining Your Swimming Pool? Read This First!
The most sensible and economical way of lowering the CyA is by draining the pool partially and pumping in fresh water.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in pg 7.
Also just had this problem - @kessler 's suggestion solved it.