Skip to content

Commit

Permalink
Reset shardjedis datasource (#1939)
Browse files Browse the repository at this point in the history
Reset shardjedis dataSource before returned to pool

Related to #1920
As it had fixed in Jedis.java, SharedJedis.java should be fixed too.
  • Loading branch information
timothyzhw authored and sazzad16 committed Mar 27, 2019
1 parent 0602593 commit 79baab4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/redis/clients/jedis/ShardedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,13 @@ public void close() {
break;
}
}

ShardedJedisPool pool = this.dataSource;
this.dataSource = null;
if (broken) {
dataSource.returnBrokenResource(this);
pool.returnBrokenResource(this);
} else {
dataSource.returnResource(this);
pool.returnResource(this);
}
this.dataSource = null;

} else {
disconnect();
Expand Down

0 comments on commit 79baab4

Please sign in to comment.