New to HikariCP, maximumPoolSize = 1

987 views
Skip to first unread message

Roberto Ferreras

unread,
Oct 19, 2016, 3:42:45 AM10/19/16
to HikariCP
Hi.

I'm migrating an application from Tomcat JDBC pool to HikariCP.

The tests run inside an in memory H2 database.

When configuring the test's DataSource I set maximumPoolSize to 1 as I had been using until now.

But when trying to run them I get the error "Connection is not available, request timed out after 30000ms."

Setting maximumPoolSize to 2 or more works as expected.

Then I tried the production configuration with MySQL and got the same results.

Is there something I am missing or maximumPoolSize = 1 should just work?

Thanks.

Brett Wooldridge

unread,
Oct 19, 2016, 3:47:52 AM10/19/16
to HikariCP
It should work. Can you enable debug logging for the com.zaxxer.hikari package and post the logs from the first minute, as well as the timeout exception?

Roberto Ferreras

unread,
Oct 21, 2016, 7:55:15 AM10/21/16
to HikariCP
This is with maximumPoolSize = 1:

2016-10-21 13:50:55,019 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcPool - configuration:
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................false
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................null
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............null
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............null
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000
2016-10-21 13:50:55,030 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................null
2016-10-21 13:50:55,031 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName............."org.h2.jdbcx.JdbcDataSource"
2016-10-21 13:50:55,031 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................null
2016-10-21 13:50:55,084 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>, url=jdbc:h2:mem:test;IGNORECASE=TRUE;COLLATION=DEFAULT_ STRENGTH PRIMARY}
2016-10-21 13:50:55,084 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName.................null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailFast..........true
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbc4ConnectionTest.............false
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................1
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................1
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"jdbcPool"
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutorService........null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............null
2016-10-21 13:50:55,085 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................null
2016-10-21 13:50:55,086 [main] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
2016-10-21 13:50:55,088 [main] INFO  com.zaxxer.hikari.HikariDataSource - jdbcPool - Started.
2016-10-21 13:50:55,358 [main] INFO  com.zaxxer.hikari.pool.PoolBase - jdbcPool - Driver does not support get/set network timeout for connections. (org.h2.jdbc.JdbcConnection.getNetworkTimeout()I)
2016-10-21 13:50:55,480 [jdbcPool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Pool stats (total=0, active=0, idle=0, waiting=0)
2016-10-21 13:50:55,492 [jdbcPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Added connection conn1: url=jdbc:h2:mem:test user=
2016-10-21 13:50:55,492 [jdbcPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - After adding stats (total=1, active=0, idle=1, waiting=0)
2016-10-21 13:50:58,834 [main] DEBUG com.zaxxer.hikari.pool.PoolBase - jdbcPool - Reset (autoCommit) on connection conn1: url=jdbc:h2:mem:test user=
2016-10-21 13:51:25,486 [jdbcPool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Pool stats (total=1, active=1, idle=0, waiting=1)
2016-10-21 13:51:34,057 [main] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Timeout failure stats (total=1, active=1, idle=0, waiting=0)
2016-10-21 13:51:34,058 [main] WARN  org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: null
2016-10-21 13:51:34,058 [main] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - jdbcPool - Connection is not available, request timed out after 30001ms.
2016-10-21 13:51:34,140 [Thread-3] INFO  com.zaxxer.hikari.pool.HikariPool - jdbcPool - Close initiated...
2016-10-21 13:51:34,140 [Thread-3] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Before closing stats (total=1, active=0, idle=1, waiting=0)
2016-10-21 13:51:34,141 [jdbcPool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - jdbcPool - Closing connection conn1: url=jdbc:h2:mem:test user=: (connection evicted)
2016-10-21 13:51:34,142 [Thread-3] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - After closing stats (total=0, active=0, idle=0, waiting=0)
2016-10-21 13:51:34,143 [Thread-3] INFO  com.zaxxer.hikari.pool.HikariPool - jdbcPool - Closed.

And this is with maximumPoolSize = 2:

2016-10-21 13:53:54,053 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcPool - configuration:
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................false
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................null
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............null
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............null
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................null
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName............."org.h2.jdbcx.JdbcDataSource"
2016-10-21 13:53:54,061 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................null
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>, url=jdbc:h2:mem:test;IGNORECASE=TRUE;COLLATION=DEFAULT_ STRENGTH PRIMARY}
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName.................null
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............null
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailFast..........true
2016-10-21 13:53:54,102 [main] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbc4ConnectionTest.............false
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................2
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................2
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"jdbcPool"
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutorService........null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - username........................null
2016-10-21 13:53:54,103 [main] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
2016-10-21 13:53:54,104 [main] INFO  com.zaxxer.hikari.HikariDataSource - jdbcPool - Started.
2016-10-21 13:53:54,329 [main] INFO  com.zaxxer.hikari.pool.PoolBase - jdbcPool - Driver does not support get/set network timeout for connections. (org.h2.jdbc.JdbcConnection.getNetworkTimeout()I)
2016-10-21 13:53:54,446 [jdbcPool housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Pool stats (total=0, active=0, idle=0, waiting=0)
2016-10-21 13:53:54,451 [jdbcPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Added connection conn1: url=jdbc:h2:mem:test user=
2016-10-21 13:53:54,452 [jdbcPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Added connection conn2: url=jdbc:h2:mem:test user=
2016-10-21 13:53:54,452 [jdbcPool connection adder] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - After adding stats (total=2, active=0, idle=2, waiting=0)
2016-10-21 13:53:57,601 [main] DEBUG com.zaxxer.hikari.pool.PoolBase - jdbcPool - Reset (autoCommit) on connection conn1: url=jdbc:h2:mem:test user=
2016-10-21 13:54:03,786 [Thread-3] INFO  com.zaxxer.hikari.pool.HikariPool - jdbcPool - Close initiated...
2016-10-21 13:54:03,787 [Thread-3] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - Before closing stats (total=2, active=0, idle=2, waiting=0)
2016-10-21 13:54:03,788 [jdbcPool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - jdbcPool - Closing connection conn1: url=jdbc:h2:mem:test user=: (connection evicted)
2016-10-21 13:54:03,788 [jdbcPool connection closer] DEBUG com.zaxxer.hikari.pool.PoolBase - jdbcPool - Closing connection conn2: url=jdbc:h2:mem:test user=: (connection evicted)
2016-10-21 13:54:03,788 [Thread-3] DEBUG com.zaxxer.hikari.pool.HikariPool - jdbcPool - After closing stats (total=0, active=0, idle=0, waiting=0)
2016-10-21 13:54:03,789 [Thread-3] INFO  com.zaxxer.hikari.pool.HikariPool - jdbcPool - Closed.
Reply all
Reply to author
Forward
0 new messages