quarkus
quarkus copied to clipboard
quarkus.datasource."datasource-name".jdbc.min-size not honored if max-lifetime is set
Describe the bug
If we set the parameter
quarkus.datasource."datasource-name".jdbc.max-lifetime
then the size of the jdbc connection pools falls below the minimum pool size.
Expected behavior
The jdbc connection pool contains at any time at least as many connections as stated in
quarkus.datasource."datasource-name".jdbc.min-size
Actual behavior
If the parameter
quarkus.datasource."datasource-name".jdbc.max-lifetime
is set and there is no activity, then the size of the jdbc connection pool reduces to 0 after the max-lifetime has been reached.
How to Reproduce?
Step 1:
Add following configuration
quarkus.datasource."datasource-name".jdbc.max-lifetime=PT1M
quarkus.datasource."datasource-name".jdbc.min-size=100
quarkus.datasource."datasource-name".jdbc.initial-size=100
quarkus.datasource."datasource-name".jdbc.max-size=100
Step 2: Start the application
Step 3: Verify the number of connections (for instance using the metrics endpoint q/metrics/vendor)
You will find 100 connections.
Step 4: Wait for 1 Minute Check the number of connections again. The pool is 0
/cc @Sanne, @barreiro, @yrodiere
@barreiro I suspect this is an issue with Agroal, not Quarkus.
@barreiro any chance you can take a look at this?
https://github.com/mfpc/reproducer27999
Reproducer created with @gastaldi help.
STEPS TO RUN 1 - mvn clean install 2- Wait for 1 minute the pool will be clear.
@Sanne, @barreiro, @yrodiere any chance you look into it?
@barreiro any chance you could have a look at this one? Thanks!
@gsmet sure, I'll investigate.
AG-197 fixed with #39072