r2dbc-pool
r2dbc-pool copied to clipboard
Define what timeout are configurable
According to https://github.com/reactor/reactor-pool/issues/34, I read there are 3 timeout:
- Timeout for getting actual resource from allocator. (connection from
ConnectionFactory
). => usePoolBuilder.from(allocator.timeout())
- the pool is depleted and resources have reached to the max size, so no more new resource allocation. thus, timeout for waiting a resource to be released.
=> use
pool.acquire(Duration)
(the new method) - Both of above
=> use
pool.acquire().timeout()
@simonbasle is this correct understanding?
While thinking this, I'm thinking what would be good for connection pooling.
Currently in r2dbc-pool, timeout for 2 and 3 are configureable. (maxCreateConnectionTime
is for 2 and maxAcquireTime
for 3)
From connection-pool perspective, I think it is sufficient for making 2 and 3 configurable.
Q1: But is it too much configurable? Should we only make 3 configureable? OR, it's less, make all 1,2,3 configureable?
Q2: Validation. Currently, a user can set timeout for 3 to 10sec and 2 to 30sec. Should we put validation logic that timeout for 2 should be less than equal to timeout for 3?
My opinion is timeout for 2 and 3 are sufficient. Maybe good to have warning message for validation. Wondering what others think :)
@ttddyy that is correct for the various timeouts