@@ -242,9 +242,6 @@ def _set_keepalive_times(sock):
242
242
# main thread, to avoid the deadlock. See PYTHON-607.
243
243
u"foo" .encode ("idna" )
244
244
245
- # Remove after PYTHON-2712
246
- _MOCK_SERVICE_ID = False
247
-
248
245
249
246
def _raise_connection_failure (address , error , msg_prefix = None ):
250
247
"""Convert a socket.error to ConnectionFailure and raise it."""
@@ -619,12 +616,6 @@ def _hello(self, cluster_time, topology_version, heartbeat_frequency, all_creden
619
616
cmd ["speculativeAuthenticate" ] = auth_ctx .speculate_command ()
620
617
621
618
doc = self .command ("admin" , cmd , publish_events = False , exhaust_allowed = awaitable )
622
- # PYTHON-2712 will remove this topologyVersion fallback logic.
623
- if self .opts .load_balanced and _MOCK_SERVICE_ID :
624
- process_id = doc .get ("topologyVersion" , {}).get ("processId" )
625
- doc .setdefault ("serviceId" , process_id )
626
- if not self .opts .load_balanced :
627
- doc .pop ("serviceId" , None )
628
619
hello = IsMaster (doc , awaitable = awaitable )
629
620
self .is_writable = hello .is_writable
630
621
self .max_wire_version = hello .max_wire_version
@@ -661,9 +652,6 @@ def _next_reply(self):
661
652
unpacked_docs = reply .unpack_response ()
662
653
response_doc = unpacked_docs [0 ]
663
654
helpers ._check_command_response (response_doc , self .max_wire_version )
664
- # Remove after PYTHON-2712.
665
- if not self .opts .load_balanced :
666
- response_doc .pop ("serviceId" , None )
667
655
return response_doc
668
656
669
657
def command (
0 commit comments