-
Bug
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
False
-
None
-
False
Repro
prop file like
org.infinispan.agroal.minSize=2
org.infinispan.agroal.maxSize=8
org.infinispan.agroal.initialSize=2
org.infinispan.agroal.acquisitionTimeout=PT5S
org.infinispan.agroal.validationTimeout=PT10S
org.infinispan.agroal.reapTimeout=PT5M
org.infinispan.agroal.jdbcUrl=jdbc:postgresql://postgres:5432/infinispan
org.infinispan.agroal.providerClassName=org.postgresql.Driver
org.infinispan.agroal.principal=postgres
org.infinispan.agroal.credential=postgres
then read properties from the props file (this is how Infinispan reads them)
dataSource = AgroalDataSource.from(new AgroalPropertiesReader(PROPERTIES_PREFIX).readProperties(propsFile));
Expected
validation occurs and WORKS on invalid connections
Actual
validation occurs and ALWAYS succeeds even for faulted connections as the validator defaults to "empty" which always returns `isValid = true` and failed connections never leave the pool.
Workaround
Instead of validationTimeout, set up maxLifetime.
That way connections will be forcefully deleted from the pool regardless the fact they are closed or not, but at least there won't be an outage.
Proposal
Add the ability to parse validator from props, e.g.
org.infinispan.agroal.validator=default