{"action":"created","issue":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/104","labels_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/104/comments","events_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/104/events","html_url":"https://github.com/brettwooldridge/HikariCP/issues/104","id":37239407,"number":104,"title":"java.sql.SQLException: Timeout of 30000ms encountered waiting for connection","user":{"login":"JohnMerlino1","id":233574,"avatar_url":"https://avatars.githubusercontent.com/u/233574?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnMerlino1","html_url":"https://github.com/JohnMerlino1","followers_url":"https://api.github.com/users/JohnMerlino1/followers","following_url":"https://api.github.com/users/JohnMerlino1/following{/other_user}","gists_url":"https://api.github.com/users/JohnMerlino1/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnMerlino1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnMerlino1/subscriptions","organizations_url":"https://api.github.com/users/JohnMerlino1/orgs","repos_url":"https://api.github.com/users/JohnMerlino1/repos","events_url":"https://api.github.com/users/JohnMerlino1/events{/privacy}","received_events_url":"https://api.github.com/users/JohnMerlino1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2014-07-07T04:56:43Z","updated_at":"2015-03-28T13:37:01Z","closed_at":"2015-03-28T13:16:06Z","body":"I am testing a little udp server I created. In my test environment, I have a udp client that runs every 30 seconds and it sends  a packet to the server. The server decodes packet and inserts data into postgresql database. There is absolutely no load on this. Yet, sometimes I get this error:\r\n\r\njava.sql.SQLException: Timeout of 30000ms encountered waiting for connection\r\n\r\nresulting from this code:\r\n\r\n\t    conn = dbPool.getConnection();\r\n\t    stmt = conn.createStatement();\r\n\t    status = stmt.executeUpdate(sql);\r\n\r\ndbPool is simply an abstraction of HikariCp:\r\n\r\n        HikariConfig config = new HikariConfig();  \r\n\tconfig.setMaximumPoolSize(50);\r\n\tconfig.setDataSourceClassName(\"org.postgresql.ds.PGSimpleDataSource\");\r\n\tconfig.addDataSourceProperty(\"serverName\", host);\r\n\tconfig.addDataSourceProperty(\"databaseName\", database);\r\n\tconfig.addDataSourceProperty(\"portNumber\", \"5432\");\r\n\tconfig.addDataSourceProperty(\"user\", username);\r\n\tconfig.addDataSourceProperty(\"password\", password);\r\n        ds = new HikariDataSource(config);\r\n\r\n    public Connection getConnection()  throws SQLException  \r\n    {  \r\n        return ds.getConnection();  \r\n    }\r\n\r\nWhy am I getting a connection timeout with hikaricp within this light test environment with only one request every 30 seconds?"},"comment":{"url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/comments/87230463","html_url":"https://github.com/brettwooldridge/HikariCP/issues/104#issuecomment-87230463","issue_url":"https://api.github.com/repos/brettwooldridge/HikariCP/issues/104","id":87230463,"user":{"login":"adnanisajbeg","id":3795380,"avatar_url":"https://avatars.githubusercontent.com/u/3795380?v=3","gravatar_id":"","url":"https://api.github.com/users/adnanisajbeg","html_url":"https://github.com/adnanisajbeg","followers_url":"https://api.github.com/users/adnanisajbeg/followers","following_url":"https://api.github.com/users/adnanisajbeg/following{/other_user}","gists_url":"https://api.github.com/users/adnanisajbeg/gists{/gist_id}","starred_url":"https://api.github.com/users/adnanisajbeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adnanisajbeg/subscriptions","organizations_url":"https://api.github.com/users/adnanisajbeg/orgs","repos_url":"https://api.github.com/users/adnanisajbeg/repos","events_url":"https://api.github.com/users/adnanisajbeg/events{/privacy}","received_events_url":"https://api.github.com/users/adnanisajbeg/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T13:37:01Z","updated_at":"2015-03-28T13:37:01Z","body":"That's great! Thank you\n\nOn Sat, Mar 28, 2015 at 2:16 PM, Brett Wooldridge <notifications@github.com>\nwrote:\n\n> @adnanisajbeg <https://github.com/adnanisajbeg> Just to let you know,\n> we've committed changes to the master branch to add \"connection closure\n> reasons\" to the debug log of the connection closer above. It will appear in\n> the future 2.4.0 release.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/brettwooldridge/HikariCP/issues/104#issuecomment-87226673>\n> .\n>\n"}}