Skip to content

Commit 7e9f19f

Browse files
committed
update backoff criteria
1 parent 679807e commit 7e9f19f

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
@@ -1033,7 +1033,7 @@ def _handle_connection_error(self, error: Exception, phase: str) -> None:
10331033
# Handle system overload condition. When the base AutoReconnect is
10341034
# raised and we are not an sdam pool, add to backoff and add the
10351035
# appropriate error label.
1036-
if not self.is_sdam and "[Errno 54] Connection reset by peer" in str(error):
1036+
if not self.is_sdam and "connection reset by peer" in str(error).lower():
10371037
self._backoff += 1
10381038
error._add_error_label("SystemOverloaded")
10391039
error._add_error_label("Retryable")

pymongo/synchronous/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def _handle_connection_error(self, error: Exception, phase: str) -> None:
10291029
# Handle system overload condition. When the base AutoReconnect is
10301030
# raised and we are not an sdam pool, add to backoff and add the
10311031
# appropriate error label.
1032-
if not self.is_sdam and "[Errno 54] Connection reset by peer" in str(error):
1032+
if not self.is_sdam and "connection reset by peer" in str(error).lower():
10331033
self._backoff += 1
10341034
error._add_error_label("SystemOverloaded")
10351035
error._add_error_label("Retryable")

0 commit comments

Comments
 (0)