Hikari无法检测到连接保持打开状态且hikarihousekeeping日志丢失的泄漏检测阈值

时间:2019-04-25 11:58:43

标签: hikaricp

Environment
HikariCP version: 3.3.1
JDK version     : 1.8.0_111
Database        : MySQL
Driver version  : 5.1
Here's my config values:

2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - Driver class com.mysql.cj.jdbc.Driver found in Thread context class loader sun.misc.Launcher$AppClassLoader@18b4aac2 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - MySQLConnectionPool - configuration: 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................true 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{autoReconnect=true, password=<masked>} 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName................."com.mysql.cj.jdbc.Driver" 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{} 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................jdbc:mysql://localhost:3306/push_notifications 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........15000 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................40 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................com.codahale.metrics.MetricRegistry@48cf2b5a 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................40 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked> 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"MySQLConnectionPool" 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - schema..........................none 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................internal 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............default 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - username........................"root" 2019-04-25 16:58:37 [pool-1-thread-17] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000

我故意断开了连接,导致连接超时,但是我从未从hikari收到泄漏检测阈值错误。我尝试将LeakDetectionthreshold值设置为最小可能的2000。公制注册表运行正常。发生了什么?另外,我在以下地方读到了

应该每30秒给出一次hikari日志。我只有在应用程序启动时才能看到这一点。

这是我设置值的方式:

`

 if (ds == null || ds.isClosed()) {
                //after setting up basic ones

                config.addDataSourceProperty("autoReconnect", true);

                config.setLeakDetectionThreshold(15000);

                config.setMetricRegistry(ApplicationUtils.getMetricRegistry());

                config.setPoolName("MySQLConnectionPool");
                ds = new HikariDataSource(config);
                LOGGER.info("Created DS in MySQL", ds);
            }`

完全没有Hikari管家的日志。看起来好像没有运行

0 个答案:

没有答案