{"action":"created","issue":{"url":"https://api.github.com/repos/xetorthio/jedis/issues/847","labels_url":"https://api.github.com/repos/xetorthio/jedis/issues/847/labels{/name}","comments_url":"https://api.github.com/repos/xetorthio/jedis/issues/847/comments","events_url":"https://api.github.com/repos/xetorthio/jedis/issues/847/events","html_url":"https://github.com/xetorthio/jedis/issues/847","id":53820737,"number":847,"title":"Possible resource leak in disconnect()","user":{"login":"allanwax","id":8459774,"avatar_url":"https://avatars.githubusercontent.com/u/8459774?v=3","gravatar_id":"","url":"https://api.github.com/users/allanwax","html_url":"https://github.com/allanwax","followers_url":"https://api.github.com/users/allanwax/followers","following_url":"https://api.github.com/users/allanwax/following{/other_user}","gists_url":"https://api.github.com/users/allanwax/gists{/gist_id}","starred_url":"https://api.github.com/users/allanwax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allanwax/subscriptions","organizations_url":"https://api.github.com/users/allanwax/orgs","repos_url":"https://api.github.com/users/allanwax/repos","events_url":"https://api.github.com/users/allanwax/events{/privacy}","received_events_url":"https://api.github.com/users/allanwax/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-09T00:43:10Z","updated_at":"2015-01-23T07:24:45Z","closed_at":null,"body":"In `Connection`\r\n\r\n```java\r\n\tpublic void disconnect() {\r\n\t\tif (isConnected()) {\r\n\t\t\ttry {\r\n\t\t\t\tinputStream.close();\r\n\t\t\t\tif (!socket.isClosed()) {\r\n\t\t\t\t\toutputStream.close();\r\n\t\t\t\t\tsocket.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (IOException ex) {\r\n\t\t\t\tbroken = true;\r\n\t\t\t\tthrow new JedisConnectionException(ex);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n```\r\n\r\nIf either `inputStream` or `outputStream` fails during close, the socket is never closed.  Sockets are one of the few things that if they are not closed the kernel will keep them 'open' and deny reuse of the resource.\r\n\r\nBetter would be separate `try ... catch` clauses which will eventually get to closing the socket."},"comment":{"url":"https://api.github.com/repos/xetorthio/jedis/issues/comments/71156622","html_url":"https://github.com/xetorthio/jedis/issues/847#issuecomment-71156622","issue_url":"https://api.github.com/repos/xetorthio/jedis/issues/847","id":71156622,"user":{"login":"luyee","id":3666051,"avatar_url":"https://avatars.githubusercontent.com/u/3666051?v=3","gravatar_id":"","url":"https://api.github.com/users/luyee","html_url":"https://github.com/luyee","followers_url":"https://api.github.com/users/luyee/followers","following_url":"https://api.github.com/users/luyee/following{/other_user}","gists_url":"https://api.github.com/users/luyee/gists{/gist_id}","starred_url":"https://api.github.com/users/luyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luyee/subscriptions","organizations_url":"https://api.github.com/users/luyee/orgs","repos_url":"https://api.github.com/users/luyee/repos","events_url":"https://api.github.com/users/luyee/events{/privacy}","received_events_url":"https://api.github.com/users/luyee/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T07:24:45Z","updated_at":"2015-01-23T07:24:45Z","body":"Unfortunately , It happend"}}