Conversation
JAVA-6141
There was a problem hiding this comment.
Pull request overview
Adds the maxAdaptiveRetries configuration surface area (settings + connection string/URI parsing) per the client backpressure specification, along with related documentation updates for retry/error labels.
Changes:
- Add
maxAdaptiveRetriestoMongoClientSettings,ConnectionString, and legacyMongoClientOptions/MongoClientURI, including equality/hash updates. - Parse/propagate the
maxAdaptiveRetriesURI option and add unit tests validating defaults and invalid values. - Improve/extend public docs for transaction and overload-related error labels across Java/Scala/Kotlin APIs.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| driver-core/src/main/com/mongodb/MongoClientSettings.java | Adds maxAdaptiveRetries field + builder API + connection string application + equality/toString updates |
| driver-core/src/main/com/mongodb/ConnectionString.java | Adds maxAdaptiveRetries option parsing, key registration, getter, and equality/hash updates |
| driver-core/src/main/com/mongodb/MongoException.java | Updates error label documentation (transactions + overload/retryable labels) |
| driver-core/src/test/unit/com/mongodb/ConnectionStringUnitTest.java | Adds coverage for maxAdaptiveRetries parsing, defaults, equals/hashCode |
| driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java | Extends generic option validation to include maxAdaptiveRetries |
| driver-core/src/test/unit/com/mongodb/MongoClientSettingsSpecification.groovy | Adds builder validation + propagation/default tests for maxAdaptiveRetries |
| driver-legacy/src/main/com/mongodb/MongoClientOptions.java | Exposes maxAdaptiveRetries via legacy options getter/builder |
| driver-legacy/src/main/com/mongodb/MongoClientURI.java | Documents and propagates maxAdaptiveRetries from URI to legacy builder |
| driver-legacy/src/test/unit/com/mongodb/MongoClientURISpecification.groovy | Adds URI parsing/override/equality tests for maxAdaptiveRetries |
| driver-legacy/src/test/unit/com/mongodb/MongoClientOptionsSpecification.groovy | Adds builder validation + default/null/0 tests for legacy options |
| driver-sync/src/main/com/mongodb/client/ClientSession.java | Adds Javadoc @see pointers to transaction error labels |
| driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/ClientSession.java | Adds Javadoc @see pointers to transaction error labels |
| driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/ClientSession.kt | Adds KDoc @see pointers to transaction error labels |
| driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/ClientSession.kt | Adds KDoc @see pointers to transaction error labels |
| driver-scala/src/main/scala/org/mongodb/scala/package.scala | Adds/extends Scala API docs/constants for overload/retryable error labels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @ParameterizedTest | ||
| @ValueSource(strings = { | ||
| "serverMonitoringMode=stream", | ||
| "maxAdaptiveRetries=42" | ||
| }) | ||
| void equalAndHashCode(final String connectionStringOptions) { | ||
| ConnectionString default1 = new ConnectionString(DEFAULT_OPTIONS); | ||
| ConnectionString default2 = new ConnectionString(DEFAULT_OPTIONS); | ||
| String connectionString = DEFAULT_OPTIONS + connectionStringOptions; | ||
| ConnectionString actual1 = new ConnectionString(connectionString); | ||
| ConnectionString actual2 = new ConnectionString(connectionString); | ||
| assertAll( | ||
| () -> assertEquals(default1, default2), | ||
| () -> assertEquals(default1.hashCode(), default2.hashCode()), | ||
| () -> assertEquals(actual1, actual2), | ||
| () -> assertEquals(actual1.hashCode(), actual2.hashCode()), | ||
| () -> assertNotEquals(default1, actual1) | ||
| ); |
There was a problem hiding this comment.
- I moved the
equalAndHashCodeso that it is near thedefaultstest, because both of these tests are not specific to any options. The rest of the tests in this file are option-specific. - I also modified the test a bit, so that we don't have to write
DEFAULT_OPTIONS +each time we add a new element toValueSource.strings.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| /** | ||
| * The codec registry to use, or null if not set. | ||
| * The codec registry to use. |
There was a problem hiding this comment.
This one was found by me as a result of reacting to a not-directly-related AI comment: getCodecRegistry cannot return null.
The relevant specification from DRIVERS-3427
Search for
maxAdaptiveRetriesatA concrete commit is specified instead of
masterbecause this is the last commit included in the DRIVERS-3160 Client Backpressure Support epic. Any newer commits are either irrelevant or are included in the DRIVERS-3337 Client Backpressure Improvements epic, which we do not care about for now.AI usage
All modifications were done by the author. AI was used only to review the changes locally (Claude Code), and to review the GitHub PR (Copilot).
JAVA-6141