{"action":"created","issue":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/1183","repository_url":"https://api.github.com/repos/brettwooldridge/HikariCP","labels_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/1183/labels{/name}","comments_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/1183/comments","events_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/1183/events","html_url":"https://github.com/brettwooldridge/HikariCP/issues/1183","id":334158438,"node_id":"MDU6SXNzdWUzMzQxNTg0Mzg=","number":1183,"title":"Pool Connections were not getting released and application gets hanged by throwing java.sql.SQLException waiting for connection ","user":{"login":"subbumopuri","id":40434664,"node_id":"MDQ6VXNlcjQwNDM0NjY0","avatar_url":"https://avatars1.githubusercontent.com/u/40434664?v=4","gravatar_id":"","url":"https://api.github.com/users/subbumopuri","html_url":"https://github.com/subbumopuri","followers_url":"https://api.github.com/users/subbumopuri/followers","following_url":"https://api.github.com/users/subbumopuri/following{/other_user}","gists_url":"https://api.github.com/users/subbumopuri/gists{/gist_id}","starred_url":"https://api.github.com/users/subbumopuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/subbumopuri/subscriptions","organizations_url":"https://api.github.com/users/subbumopuri/orgs","repos_url":"https://api.github.com/users/subbumopuri/repos","events_url":"https://api.github.com/users/subbumopuri/events{/privacy}","received_events_url":"https://api.github.com/users/subbumopuri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-20T16:33:39Z","updated_at":"2018-12-18T03:11:50Z","closed_at":"2018-07-11T12:20:40Z","author_association":"NONE","body":"#### Environment\r\n```\r\nHikariCP version: 2.7.4\r\nJDK version     : 1.8.0_151\r\nDatabase        : Oracle 12c\r\nJDBC Driver    : ojdbc8\r\nTomcat version : 8.5.12\r\n```\r\n<sup>Hi @brettwooldridge,\r\n\r\nWe have migrated connection pool from primerose (leagcy) to HikariCP in our application. When we perform load test with 10 and 20 users below errors were occurring and connections were not getting closed even after the load test completes.\r\n\r\nConnections are not getting closed,even application also not working and throwing SQLException and we had to restart the tomcat server whenever load test is performed.\r\n\r\nWe tried with increasing the maximumPoolSize from 25,50, 100, 200. When performing with more poolSize then there was no issue. But this seems to be strange, that for handling requests below 5000 also we need to configure more pool size which was not desirable.\r\n\r\nHikariCP config\r\n        class=\"com.zaxxer.hikari.HikariDataSource\" destroy-method=\"close\"\r\n        p:username=\"${database.jdbc.username}\"\r\n        p:password=\"${database.jdbc.password}\"\r\n        p:jdbcUrl=\"${database.jdbc.url}\"\r\n        p:readOnly=\"true\"\r\n        p:driverClassName=\"oracle.jdbc.OracleDriver\"\r\n        p:initializationFailFast=\"true\"\r\n        p:leakDetectionThreshold=\"120000\"\r\n        p:connectionTimeout=\"45000\"\r\n        p:autoCommit=\"false\"\r\n        p:minimumIdle=\"5\"\r\n        p:maximumPoolSize=\"50\"  \r\n\r\n         defaultRowPrefetch = 250\r\n         oracle.jdbc.TcpNoDelay= true\r\n\r\nPlease find below logs\r\n============================\r\n**DEBUG {HH:mm:ss.SSS} c.z.hikari.pool.ProxyConnection - HikariPool-2 - Executed rollback on connection oracle.jdbc.driver.T4CConnection@1a922b2 due to dirty commit state on close().\r\nDEBUG {HH:mm:ss.SSS} c.z.hikari.pool.ProxyConnection - HikariPool-2 - Executed rollback on connection oracle.jdbc.driver.T4CConnection@895983 due to dirty commit state on close().\r\n[pool-9-thread-4] DEBUG {HH:mm:ss.SSS} c.z.hikari.pool.ProxyConnection - HikariPool-2 - Executed rollback on connection oracle.jdbc.driver.T4CConnection@1a922b2 due to dirty commit state on close().\r\n[pool-9-thread-6] DEBUG {HH:mm:ss.SSS} c.z.hikari.pool.ProxyConnection - HikariPool-2 - Executed rollback on connection oracle.jdbc.driver.T4CConnection@18bc456 due to dirty commit state on close().\r\n[pool-9-thread-1] DEBUG {HH:mm:ss.SSS} c.z.hikari.pool.ProxyConnection - HikariPool-2 - Executed rollback on connection oracle.jdbc.driver.T4CConnection@1a922b2 due to dirty commit state on close().\r\n[pool-9-thread-2] DEBUG {HH:mm:ss.SSS} c.z.hikari.pool.ProxyConnection - HikariPool-2 - Executed rollback on connection oracle.jdbc.driver.T4CConnection@18bc456 due to dirty commit state on close().\r\n[HikariPool-2 housekeeper] WARN  {HH:mm:ss.SSS} c.zaxxer.hikari.pool.ProxyLeakTask - Connection leak detection triggered for oracle.jdbc.driver.T4CConnection@1b453b8 onthread http-nio-13.129.103.19-8085-exec-4, stack trace follows\r\njava.lang.Exception: Apparent connection leak detected at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-2.7.4.jar:na]\r\n....\r\n....\t\t\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Before cleanup stats (total=50, active=50, idle=0, waiting=13)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - After cleanup  stats (total=50, active=50, idle=0, waiting=13)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Timeout failure stats (total=50, active=50, idle=0, waiting=13)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Timeout failure stats (total=50, active=50, idle=0, waiting=12)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Timeout failure stats (total=50, active=50, idle=0, waiting=12)\r\n.....\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 -Before cleanup stats (total=50, active=50, idle=0, waiting=1)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - After cleanup  stats (total=50, active=50, idle=0, waiting=1)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Timeout failure stats (total=50, active=50, idle=0, waiting=0)\r\n.....\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Before cleanup stats (total=50, active=50, idle=0, waiting=0)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - After cleanup  stats (total=50, active=50, idle=0, waiting=0)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Before cleanup stats (total=50, active=50, idle=0, waiting=0)\r\nDEBUG {HH:mm:ss.SSS} com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - After cleanup  stats (total=50, active=50, idle=0, waiting=0)**\r\n\r\n======================================\r\nAnd after the load test completed and if we try to access the application we are getting below errors\r\n**java.sql.SQLException: Timeout of 450000ms encountered waiting for connection** \r\n\r\nCan you please advise here in this scenario.\r\n</sup>\r\n\r\n-----------------------------------------------------------------------------------------\r\n*Have you searched the CLOSED issues already? How about checking [stackoverflow](https://stackoverflow.com/search?q=HikariCP)?*\r\n"},"comment":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/comments/448081329","html_url":"https://github.com/brettwooldridge/HikariCP/issues/1183#issuecomment-448081329","issue_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/1183","id":448081329,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODA4MTMyOQ==","user":{"login":"brettwooldridge","id":1538661,"node_id":"MDQ6VXNlcjE1Mzg2NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/1538661?v=4","gravatar_id":"","url":"https://api.github.com/users/brettwooldridge","html_url":"https://github.com/brettwooldridge","followers_url":"https://api.github.com/users/brettwooldridge/followers","following_url":"https://api.github.com/users/brettwooldridge/following{/other_user}","gists_url":"https://api.github.com/users/brettwooldridge/gists{/gist_id}","starred_url":"https://api.github.com/users/brettwooldridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettwooldridge/subscriptions","organizations_url":"https://api.github.com/users/brettwooldridge/orgs","repos_url":"https://api.github.com/users/brettwooldridge/repos","events_url":"https://api.github.com/users/brettwooldridge/events{/privacy}","received_events_url":"https://api.github.com/users/brettwooldridge/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T03:11:50Z","updated_at":"2018-12-18T03:11:50Z","author_association":"OWNER","body":"@carloshager you case sounds like a connection leak.  Please set the leakDetectionThreshold and check your logs."}}
{"actor":{"display_login":"brettwooldridge"}}