Skip to content

Commit b5a8133

Browse files
committed
Added health_check thread cancelling in BlockingPool
1 parent 01e405e commit b5a8133

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

redis/connection.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,3 +1669,11 @@ def disconnect(self):
16691669
self._checkpid()
16701670
for connection in self._connections:
16711671
connection.disconnect()
1672+
1673+
# Send an event to stop scheduled healthcheck execution.
1674+
if self._hc_cancel_event is not None and not self._hc_cancel_event.is_set():
1675+
self._hc_cancel_event.set()
1676+
1677+
# Joins healthcheck thread on disconnect.
1678+
if self._hc_thread is not None and not self._hc_thread.is_alive():
1679+
self._hc_thread.join()

0 commit comments

Comments
 (0)