r2dbc / r2dbc-pool

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

Fix immediate eviction for default `maxLifeTime` #155

Closed patriknw closed 2 years ago

patriknw commented 2 years ago

Fixes #129

patriknw commented 2 years ago

@mp911de friendly ping, if you have a moment to review this fix

GabrielCalin commented 2 years ago

@patriknw just a small suggestion, as I've stumbled upon this bug myself, I think it's easier to just replaceif (maxIdleTimeMills == 0 || maxLifeTimeMillis == 0) with if (maxIdleTime.isZero() || maxLifeTime.isZero()) in the evictionPredicate, this way it's just one line of code changed, the code is easier to read and all tests will pass.

cemo commented 2 years ago

@mp911de can you please merge this? This is a serious issue and affect performance badly.

mp911de commented 2 years ago

Thank you for your contribution. That's merged and backported now.