r2d2 icon indicating copy to clipboard operation
r2d2 copied to clipboard

Document relationship between `min_idle`, `idle_timeout` and `max_lifetime`

Open xmo-odoo opened this issue 3 years ago • 1 comments

Looking at the documentation of Builder doesn't currently help understand r2d2's behaviour, when trying to answer questions like "how do I make sure there's always at least one connection at any given instant".

This is related to ivanceras/r2d2-sqlite#39: currently ::memory is basically broken (at least in the sense of pooling connection, every connection from the pool is independent).

It's possible that sqlite's mode=memory could be used to fix the issue (at least in part, it has limitations still) but sqlite will automatically delete and release the database if it has no connections open, so for this to work properly there needs to be a way to configure the pool such that once the first connection has been created there is always at least one connection in the pool at any instant.

xmo-odoo avatar Feb 18 '22 08:02 xmo-odoo

If you set idle_timeout and max_lifetime to None, your connections should always stay open.

sfackler avatar Feb 18 '22 12:02 sfackler