Skip to content

Commit 0997248

Browse files
committed
add sdam check
1 parent 6f38a9b commit 0997248

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pymongo/asynchronous/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ async def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> A
11061106
async with self.lock:
11071107
self.active_contexts.discard(conn.cancel_context)
11081108
# Enter backoff mode and reconnect on establishment failure.
1109-
if type(e) == AutoReconnect:
1109+
if not self.is_sdam and type(e) == AutoReconnect:
11101110
await conn.close_conn(ConnectionClosedReason.ERROR)
11111111
self._backoff += 1
11121112
# TODO: emit a message about backoff.

pymongo/synchronous/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> Connect
11021102
with self.lock:
11031103
self.active_contexts.discard(conn.cancel_context)
11041104
# Enter backoff mode and reconnect on establishment failure.
1105-
if type(e) == AutoReconnect:
1105+
if not self.is_sdam and type(e) == AutoReconnect:
11061106
conn.close_conn(ConnectionClosedReason.ERROR)
11071107
self._backoff += 1
11081108
# TODO: emit a message about backoff.

0 commit comments

Comments
 (0)