Skip to content

Commit e72961b

Browse files
last changes
1 parent 611a17c commit e72961b

File tree

6 files changed

+54
-431
lines changed

6 files changed

+54
-431
lines changed

src/operations/execute_operation.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,10 @@ async function executeOperationWithRetries<
261261
let attempt = 0;
262262
attempt < retryContext.maxAttempts;
263263
attempt++,
264-
retryContext.maxAttempts = previousOperationError?.hasErrorLabel(
265-
MongoErrorLabel.SystemOverloadedError
266-
)
267-
? 6
268-
: retryContext.maxAttempts
264+
retryContext.maxAttempts =
265+
willRetry && previousOperationError?.hasErrorLabel(MongoErrorLabel.SystemOverloadedError)
266+
? 6
267+
: retryContext.maxAttempts
269268
) {
270269
if (previousOperationError) {
271270
if (hasWriteAspect && previousOperationError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) {

test/spec/client-backpressure/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Drivers should test that retries do not occur immediately when a SystemOverloade
3535
}
3636
```
3737

38-
3. Execute the document `{ a: 1 }`. Expect that the command errors. Measure the duration of the command execution.
38+
3. Insert the document `{ a: 1 }`. Expect that the command errors. Measure the duration of the command execution.
3939

4040
```javascript
4141
const start = performance.now();
@@ -55,7 +55,3 @@ Drivers should test that retries do not occur immediately when a SystemOverloade
5555
```
5656
The sum of 5 backoffs is 3.1 seconds. There is a 1-second window to account for potential variance between the two
5757
runs.
58-
59-
## Changelog
60-
61-
- 2025-XX-XX: Initial version.

0 commit comments

Comments
 (0)