Skip to content

Commit 452cdd6

Browse files
committed
add retryable label
1 parent 7734af7 commit 452cdd6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pymongo/asynchronous/pool.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,8 @@ async def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> A
11111111
if not self.is_sdam and type(e) == AutoReconnect:
11121112
self._backoff += 1
11131113
e._add_error_label("SystemOverloaded")
1114+
e._add_error_label("Retryable")
1115+
print("Setting backoff:", self._backoff) # noqa: T201
11141116
await conn.close_conn(ConnectionClosedReason.ERROR)
11151117
raise
11161118

pymongo/synchronous/pool.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,8 @@ def connect(self, handler: Optional[_MongoClientErrorHandler] = None) -> Connect
11071107
if not self.is_sdam and type(e) == AutoReconnect:
11081108
self._backoff += 1
11091109
e._add_error_label("SystemOverloaded")
1110+
e._add_error_label("Retryable")
1111+
print("Setting backoff:", self._backoff) # noqa: T201
11101112
conn.close_conn(ConnectionClosedReason.ERROR)
11111113
raise
11121114

0 commit comments

Comments
 (0)