Skip to content

Commit

Permalink
Fix leak connection when discovering cluster nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils authored and HeartSaVioR committed Dec 18, 2014
1 parent d7f6091 commit e5b6af2
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ public void assignSlotToNode(int slot, HostAndPort targetNode) {

private void initializeSlotsCache(Set<HostAndPort> startNodes, GenericObjectPoolConfig poolConfig) {
for (HostAndPort hostAndPort : startNodes) {
JedisPool jp = new JedisPool(poolConfig, hostAndPort.getHost(), hostAndPort.getPort());

Jedis jedis = null;
Jedis jedis = new Jedis(hostAndPort.getHost(), hostAndPort.getPort());
try {
jedis = jp.getResource();
cache.discoverClusterNodesAndSlots(jedis);
break;
} catch (JedisConnectionException e) {
Expand Down

0 comments on commit e5b6af2

Please sign in to comment.