Repository navigation
feat(NODE-7624): support baseBackoffMS and update client backpressure backoff - #5020
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for server-provided baseBackoffMS to the client backpressure retry logic, updates the exponential backoff calculation to match the revised spec behavior, and updates handshake backpressure metadata to the new wire representation.
Changes:
- Introduces
calculateBaseBackoffMS()and uses it to compute overload retry backoff durations inexecuteOperation. - Updates retry backoff math in transactions and client-backpressure prose tests to reflect the new backoff schedule.
- Changes handshake
backpressuremetadata fromtrueto the new'2'representation and updates related tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/operations/execute_operation.test.ts | Adds unit tests for calculateBaseBackoffMS() behavior. |
| test/spec/client-backpressure/README.md | Updates prose spec text for revised backoff schedule and adds baseBackoffMS prose steps. |
| test/integration/transactions-convenient-api/transactions-convenient-api.prose.test.ts | Adjusts expected retry-backoff timing for transaction convenient API prose test. |
| test/integration/mongodb-handshake/mongodb-handshake.prose.test.ts | Updates handshake backpressure assertions to expect '2'. |
| test/integration/client-backpressure/client-backpressure.prose.test.ts | Updates backoff timing assertions and adds an integration test for server-provided baseBackoffMS. |
| src/sessions.ts | Updates transaction retry backoff exponent to match new attempt numbering. |
| src/operations/execute_operation.ts | Exposes base backoff constant, adds calculateBaseBackoffMS(), and updates overload retry backoff calculation. |
| src/cmap/connect.ts | Updates handshake document backpressure metadata type/value to '2'. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
johnmtll
reviewed
Aug 14, 2026
johnmtll
reviewed
Aug 14, 2026
johnmtll
requested changes
Aug 14, 2026
johnmtll
previously approved these changes
Aug 14, 2026
johnmtll
approved these changes
Aug 18, 2026
nbbeeken
approved these changes
Aug 18, 2026
dariakp
approved these changes
Aug 19, 2026
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of Changes
Add support for baseBackoffMS to existing client backpressure drivers.
This change also alters how backoffs are calculated and changes the backpressure wire representation.
Release Highlight
Improved Intelligent Workload Management
Improved performance for MongoDB 9.0's Intelligent Workload Management (IWM) by only retrying overload errors when doing so is expected to not worsen server conditions
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript