Skip to content

Commit fe5c119

Browse files
committed
PYTHON-952 - Fix killCursors for replica set connections
1 parent 414250b commit fe5c119

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pymongo/mongo_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,10 @@ def _process_kill_cursors_queue(self):
917917
for address, cursor_ids in address_to_cursor_ids.items():
918918
try:
919919
if address:
920-
server = topology.select_server_by_address(address)
920+
# address could be a tuple or _CursorAddress, but
921+
# select_server_by_address needs (host, port).
922+
server = topology.select_server_by_address(
923+
tuple(address))
921924
else:
922925
# Application called close_cursor() with no address.
923926
server = topology.select_server(

0 commit comments

Comments
 (0)