Skip to content

Commit 79baab4

Browse files
timothyzhwsazzad16
authored andcommitted
Reset shardjedis datasource (#1939)
Reset shardjedis dataSource before returned to pool Related to #1920 As it had fixed in Jedis.java, SharedJedis.java should be fixed too.
1 parent 0602593 commit 79baab4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/redis/clients/jedis/ShardedJedis.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -822,13 +822,13 @@ public void close() {
822822
break;
823823
}
824824
}
825-
825+
ShardedJedisPool pool = this.dataSource;
826+
this.dataSource = null;
826827
if (broken) {
827-
dataSource.returnBrokenResource(this);
828+
pool.returnBrokenResource(this);
828829
} else {
829-
dataSource.returnResource(this);
830+
pool.returnResource(this);
830831
}
831-
this.dataSource = null;
832832

833833
} else {
834834
disconnect();

0 commit comments

Comments
 (0)