Open hardikdesai81 opened 5 years ago
I recommend enabling debug logging for HikariCP. It should provide more information about the reason for the failure.
Please post relevant sections of the log here or attach a log file (zipped).
Hi Hardik,
There are two scenarios.
Thanks, Nitish
On Sat, 6 Apr, 2019, 1:13 PM Brett Wooldridge, notifications@github.com wrote:
I recommend enabling debug logging for HikariCP. It should provide more information about the reason for the failure.
Please post relevant sections of the log here or attach a log file (zipped).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brettwooldridge/HikariCP/issues/1352#issuecomment-480483203, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9kWsIraQAjCkId-lXQiipUxIjRni76ks5veFAugaJpZM4cb0Gs .
Hi @NitishBangera & @brettwooldridge
I would like to confirm that behavior using MySQL and Mongo DB My use case happens when I have a huge amount of DB operations targeting Mongo, sometimes I had to reprocess some data and then I fall in the same basket of @hardikdesai81 In such reprocessing MySQL is not even invoked only Mongo is involved in the transactions so why the Hikari looks like to be managing the mongo connections? Would that be a Spring Data issue?
HikariCP version: 3.2.0
JDK version: openjdk:11-jdk (docker image)
Databases: Mysql and Mongo
Spring Boot: 2.1.9
Spring Data JPA: 2.1.19
Spring Data Mongodb 2.1.19
Pool config:
HikariPool-1 - Starting...
validationTimeout...............5000
username........................"the-username"
transactionIsolation............default
threadFactory...................internal
schema..........................none
scheduledExecutor...............none
registerMbeans..................false
readOnly........................false
poolName........................"HikariPool-1"
password........................<masked>
minimumIdle.....................10
metricsTrackerFactory...........none
metricRegistry..................none
maximumPoolSize.................10
maxLifetime.....................1800000
leakDetectionThreshold..........0
jdbcUrl.........................jdbc:mysql://db-server.acme.com:3306/the-user?useUnicode=yes&characterEncoding=UTF-8&useSSL=false
isolateInternalQueries..........false
initializationFailTimeout.......1
idleTimeout.....................600000
healthCheckRegistry.............none
healthCheckProperties...........{}
driverClassName................."com.mysql.jdbc.Driver"
dataSourceProperties............{password=<masked>}
dataSourceJNDI..................none
dataSourceClassName.............none
dataSource......................none
connectionTimeout...............30000
connectionTestQuery.............none
connectionInitSql...............none
catalog.........................none
autoCommit......................true
allowPoolSuspension.............false
HikariPool-1 - configuration:
Logs:
HikariPool-1 - Timeout failure stats (total=10, active=10, idle=0, waiting=193)
SQL Error: 0, SQLState: null
HikariPool-1 - Connection is not available, request timed out after 30000ms.
(... many many failures logged ..)
HikariPool-1 - Timeout failure stats (total=10, active=10, idle=0, waiting=270)
Could you try to use driver manager to get a connection from the oracle database Instead of jdbctemplate.getConnection() Connection con = DriverManager.getConnection("URL", "USERNAME","PASSWORD");
Had the same issue today. Our mongoDB database connections got choked. We do not have a custom connection pool for it. We do have HikariCP for mySQL. And curiously, Hikari threw an exception for a mongoDB connection which is the same pattern I see above
rent connection leak detected at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:128) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:104) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:134) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:259) at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:267) at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:246) at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:83) at org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:184) at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:402) at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:574) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:361) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:118) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) at com.hifinite.components.device.service.DeviceRawReadingJsonService$$**EnhancerBySpringCGLIB$$6def0426.insertDeviceRawReadingJson(<generated>)
**
The method DeviceRawReadingJsonService is a insert into MongoDB. Not sure why Hikari is closing or complaiing about this connection's leak.
Hello everyone,
We are facing a lot of Connection Timeout issues with Hikari Connection Pool that comes with Spring Boot 2.x. We have two databases (Mongo and Oracle) and I think they are sharing the connection pool.
Environment
Following are the Hikari Connection Pool settings that we have setup:
Following is the exception stack trace:
Please help us move forward with this problem. Any help is deeply appreciated.
Thanks, Hardik