Closed patriknw closed 2 years ago
It is possible that the timeout
operator cancels the connection creation but the connection was partially established. In that case, the timeout
operator drops the connection but we never close it on our side. That's something we need to fix.
That's fixed now.
Bug Report
Versions
Current Behavior
More connections than max and connections are not closed if maxCreateConnectionTime is defined.
Steps to reproduce
Set a small maxCreateConnectionTime that causes timeout. Look in database for open connections:
Expected behavior/code
No connection leak.
Possible Solution
I think the underlying connection can still be established but not added to the pool, or closed. The maxCreateConnectionTime is only a timeout on the Mono.
I suggest to remove maxCreateConnectionTime and let users define the timeout with
ConnectionFactoryOptions.CONNECT_TIMEOUT
.I don't know if
maxAcquireTime
can cause something similar.