{"action":"created","issue":{"url":"https://api.github.com/repos/xetorthio/jedis/issues/1253","repository_url":"https://api.github.com/repos/xetorthio/jedis","labels_url":"https://api.github.com/repos/xetorthio/jedis/issues/1253/labels{/name}","comments_url":"https://api.github.com/repos/xetorthio/jedis/issues/1253/comments","events_url":"https://api.github.com/repos/xetorthio/jedis/issues/1253/events","html_url":"https://github.com/xetorthio/jedis/pull/1253","id":146308526,"number":1253,"title":"Issue #1252: Fix creating a lot of new Jedis instances on unstable cluster, fix slots clearing without filling","user":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xetorthio/jedis/labels/WAIT%20FOR%20MORE%20REVIEWS","name":"WAIT FOR MORE REVIEWS","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/xetorthio/jedis/milestones/25","html_url":"https://github.com/xetorthio/jedis/milestones/2.8.2","labels_url":"https://api.github.com/repos/xetorthio/jedis/milestones/25/labels","id":1644560,"number":25,"title":"2.8.2","description":"","creator":{"login":"marcosnils","id":1578458,"avatar_url":"https://avatars.githubusercontent.com/u/1578458?v=3","gravatar_id":"","url":"https://api.github.com/users/marcosnils","html_url":"https://github.com/marcosnils","followers_url":"https://api.github.com/users/marcosnils/followers","following_url":"https://api.github.com/users/marcosnils/following{/other_user}","gists_url":"https://api.github.com/users/marcosnils/gists{/gist_id}","starred_url":"https://api.github.com/users/marcosnils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcosnils/subscriptions","organizations_url":"https://api.github.com/users/marcosnils/orgs","repos_url":"https://api.github.com/users/marcosnils/repos","events_url":"https://api.github.com/users/marcosnils/events{/privacy}","received_events_url":"https://api.github.com/users/marcosnils/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":3,"state":"open","created_at":"2016-03-15T01:07:51Z","updated_at":"2016-04-07T15:10:07Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2016-04-06T13:07:44Z","updated_at":"2016-04-07T15:31:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xetorthio/jedis/pulls/1253","html_url":"https://github.com/xetorthio/jedis/pull/1253","diff_url":"https://github.com/xetorthio/jedis/pull/1253.diff","patch_url":"https://github.com/xetorthio/jedis/pull/1253.patch"},"body":"I started to investigate Issue #1252 and PING-PONG counts especially.\r\n\r\nThe most interesting things I found in stack traces on our runtime:\r\n```\r\n\tat redis.clients.jedis.BinaryJedis.ping(BinaryJedis.java:106)\r\n\tat redis.clients.jedis.JedisSlotBasedConnectionHandler.getConnection(JedisSlotBasedConnectionHandler.java:41)\r\n\tat redis.clients.jedis.JedisSlotBasedConnectionHandler.getConnectionFromSlot(JedisSlotBasedConnectionHandler.java:64)\r\n\tat redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:115)\r\n\tat redis.clients.jedis.JedisClusterCommand.run(JedisClusterCommand.java:30)\r\n\tat redis.clients.jedis.JedisCluster.setex(JedisCluster.java:292)\r\n```\r\n\r\nLooks absolutely abnormal - we have nothing for slot and fallback to new Jedis to random node.\r\n\r\nHere you can find my changes and fixes for place, that could cause this issue + some refactoring, remove of some duplicate map lookups/keys building.\r\n\r\nSystem behavior before and after applying this changes:\r\n![Before](http://s21.postimg.org/yv429wlzr/2016_04_06_23_01_13.png)\r\n![After](http://s16.postimg.org/w4t1br4gl/2016_04_06_23_01_50.png)"},"comment":{"url":"https://api.github.com/repos/xetorthio/jedis/issues/comments/206954357","html_url":"https://github.com/xetorthio/jedis/pull/1253#issuecomment-206954357","issue_url":"https://api.github.com/repos/xetorthio/jedis/issues/1253","id":206954357,"user":{"login":"Spikhalskiy","id":532108,"avatar_url":"https://avatars.githubusercontent.com/u/532108?v=3","gravatar_id":"","url":"https://api.github.com/users/Spikhalskiy","html_url":"https://github.com/Spikhalskiy","followers_url":"https://api.github.com/users/Spikhalskiy/followers","following_url":"https://api.github.com/users/Spikhalskiy/following{/other_user}","gists_url":"https://api.github.com/users/Spikhalskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/Spikhalskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spikhalskiy/subscriptions","organizations_url":"https://api.github.com/users/Spikhalskiy/orgs","repos_url":"https://api.github.com/users/Spikhalskiy/repos","events_url":"https://api.github.com/users/Spikhalskiy/events{/privacy}","received_events_url":"https://api.github.com/users/Spikhalskiy/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T15:31:37Z","updated_at":"2016-04-07T15:31:37Z","body":"@HeartSaVioR Thank you! Sure, take your time. When I take a look deeply at code and possible solutions I will share my suggestions too in separate PR."}}