r2dbc / r2dbc-pool

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

Incorrect eviction predicate causing connection close #168

Closed samueldlightfoot closed 2 years ago

samueldlightfoot commented 2 years ago

ConnectionPoolConfiguration.NO_TIMEOUT uses Duration.ofNanos(-1) but ConnectionPool evictionPredicate converts the timeout to millis, causing it to evaluate to 0 and hence true, therefore closing the connection eagerly.

It should use maxLifeTime.toNanos to align with NO_TIMEOUT.

samueldlightfoot commented 2 years ago

Sorry duplicate of https://github.com/r2dbc/r2dbc-pool/pull/155