r2dbc / r2dbc-pool

Connection Pooling for Reactive Relational Database Connectivity
https://r2dbc.io
Apache License 2.0
332 stars 55 forks source link

Soft eviction for in-use connections #157

Closed nihsmik closed 2 years ago

nihsmik commented 2 years ago

Motivation

In-use connections are immediately disposed of when the max lifetime is over. I expect not to cancel any active requests even if the connection evicts.

Desired solution

How about just marking evict to lifetime over connections like HikariCP? There is no problem evicting idle connections immediately. I suggest soft-evicting the other connections that are in use. The soft evicted connection becomes idle and then closed in the background.

Additional context

HikariCP markEvicted

mp911de commented 2 years ago

Related to https://github.com/reactor/reactor-pool/issues/157, I think we need to make sure this is possible with Reactor Pool as the underlying object pool.

mp911de commented 2 years ago

Closing since the related upstream issue was closed. Without a change in Reactor Pool, we're not able to provide such a feature.