Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions driver-core/src/main/com/mongodb/ClientEncryptionSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,15 @@ public Builder keyExpiration(@Nullable final Long keyExpiration, final TimeUnit
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>Note:</strong> The timeout set through this method overrides the timeout defined in the key vault client settings
* specified in {@link #keyVaultMongoClientSettings(MongoClientSettings)}.
* Essentially, for operations that require accessing the key vault, the remaining timeout from the initial operation
* determines the duration allowed for key vault access.</p>
* <p><strong>NOTE:</strong></p>
* <ul>
* <li>The timeout set through this method overrides the timeout defined in the key vault client settings
* specified in {@link #keyVaultMongoClientSettings(MongoClientSettings)}.
* Essentially, for operations that require accessing the key vault, the remaining timeout from the initial operation
* determines the duration allowed for key vault access.</li>
* <li>When using synchronous API, this timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected. This limitation does not apply to the reactive streams API.</li>
* </ul>
*
* @param timeout the timeout
* @param timeUnit the time unit
Expand Down
5 changes: 5 additions & 0 deletions driver-core/src/main/com/mongodb/ClientSessionOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ public Builder defaultTransactionOptions(final TransactionOptions defaultTransac
* <li>{@code withTransaction}</li>
* <li>{@code close}</li>
* </ul>
*
* <p><strong>NOTE:</strong> When using synchronous API, this timeout does not limit socket writes, therefore
* there is a possibility that the operation might not be timed out when expected. This limitation does not
* apply to the reactive streams API.
*
* @param defaultTimeout the timeout
* @param timeUnit the time unit
* @return this
Expand Down
3 changes: 3 additions & 0 deletions driver-core/src/main/com/mongodb/MongoClientSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@ public Builder inetAddressResolver(@Nullable final InetAddressResolver inetAddre
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> When using synchronous API, this timeout does not limit socket writes, therefore there is a possibility that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the majority of API notes in the com.mongodb package, we should say <p>Note: When....

The same suggestion applies to the rest of the driver-core/src/main/com/mongodb files modified in the PR.

* operation might not be timed out when expected. This limitation does not apply to the reactive streams API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add this note to the MongoClientSettings.getTimeout method.

The same suggestion applies to the rest of the driver-core/src/main/com/mongodb files modified in the PR.

*
* @param timeout the timeout
* @param timeUnit the time unit
* @return this
Expand Down
3 changes: 3 additions & 0 deletions driver-core/src/main/com/mongodb/TransactionOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ public Builder maxCommitTime(@Nullable final Long maxCommitTime, final TimeUnit
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> When using synchronous API, this timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected. This limitation does not apply to the reactive streams API.
*
* @param timeout the timeout
* @param timeUnit the time unit
* @return this
Expand Down
2 changes: 1 addition & 1 deletion driver-core/src/test/resources/specifications
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should revert the changes to driver-core/src/test/resources/specifications

Submodule specifications updated 71 files
+10 −5 .pre-commit-config.yaml
+2 −0 source/index-management/index-management.md
+6 −6 source/index-management/tests/README.md
+1 −0 source/mongodb-handshake/tests/unified/metadata-not-propagated.json
+1 −0 source/mongodb-handshake/tests/unified/metadata-not-propagated.yml
+7 −4 source/retryable-reads/retryable-reads.md
+8 −5 source/retryable-writes/retryable-writes.md
+7 −3 source/server-discovery-and-monitoring/server-discovery-and-monitoring-tests.md
+21 −21 ...d-monitoring/tests/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.json
+14 −14 ...nd-monitoring/tests/unified/backpressure-server-description-unchanged-on-min-pool-size-population-error.yml
+3 −2 source/server-discovery-and-monitoring/tests/unified/minPoolSize-error.json
+3 −2 source/server-discovery-and-monitoring/tests/unified/minPoolSize-error.yml
+45 −69 source/server-discovery-and-monitoring/tests/unified/pool-clear-min-pool-size-error.json
+36 −39 source/server-discovery-and-monitoring/tests/unified/pool-clear-min-pool-size-error.yml
+8 −4 source/server-selection/server-selection-tests.md
+25 −8 source/server-selection/server-selection.md
+62 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedNearest.json
+26 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedNearest.yml
+39 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimary.json
+22 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimary.yml
+62 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimaryPreferred.json
+26 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimaryPreferred.yml
+62 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondary.json
+26 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondary.yml
+62 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryPreferred.json
+26 −0 source/server-selection/tests/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryPreferred.yml
+84 −0 ...ce/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedAllPrimaryPreferred.json
+34 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedAllPrimaryPreferred.yml
+100 −0 .../server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedAllSecondaryPreferred.json
+36 −0 ...e/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedAllSecondaryPreferred.yml
+78 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedNearest.json
+33 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedNearest.yml
+65 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimary.json
+30 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimary.yml
+84 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimaryPreferred.json
+34 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimaryPreferred.yml
+86 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondary.json
+34 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondary.yml
+78 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryPreferred.json
+33 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryPreferred.yml
+70 −0 ...ce/server-selection/tests/server_selection/ReplicaSetWithPrimary/write/DeprioritizedSecondaryPreferred.json
+30 −0 source/server-selection/tests/server_selection/ReplicaSetWithPrimary/write/DeprioritizedSecondaryPreferred.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedNearest.json
+22 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedNearest.yml
+42 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedPrimary.json
+20 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedPrimary.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedPrimaryPreferred.json
+22 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedPrimaryPreferred.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedSecondary.json
+22 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedSecondary.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedSecondaryPreferred.json
+22 −0 source/server-selection/tests/server_selection/Sharded/read/DeprioritizedSecondaryPreferred.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedNearest.json
+22 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedNearest.yml
+42 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedPrimary.json
+20 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedPrimary.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedPrimaryPreferred.json
+22 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedPrimaryPreferred.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedSecondary.json
+22 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedSecondary.yml
+47 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedSecondaryPreferred.json
+22 −0 source/server-selection/tests/server_selection/Sharded/write/DeprioritizedSecondaryPreferred.yml
+54 −0 source/server-selection/tests/server_selection/Single/read/Deprioritized.json
+20 −0 source/server-selection/tests/server_selection/Single/read/Deprioritized.yml
+54 −0 source/server-selection/tests/server_selection/Single/write/Deprioritized.json
+20 −0 source/server-selection/tests/server_selection/Single/write/Deprioritized.yml
+9 −1 source/sessions/snapshot-sessions.md
+15 −0 source/sessions/tests/README.md
+1 −1 source/transactions-convenient-api/tests/README.md
+51 −32 source/transactions-convenient-api/transactions-convenient-api.md
+2 −7 source/unified-test-format/unified-test-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public open class MongoCluster protected constructor(private val wrapped: JMongo
* - `0` means infinite timeout.
* - `> 0` The time limit to use for the full execution of an operation.
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the majority of API notes in the com.mongodb.kotlin.client package, we should say Note: This.... (Kotlin does not seen to require HTML in documentation comments).

The same suggestion applies to the MongoCluster.withTimeout method and to rest of the driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client files modified in the PR.

* operation might not be timed out when expected.
*
* @return the optional timeout duration
*/
@Alpha(Reason.CLIENT)
Expand Down Expand Up @@ -131,6 +134,9 @@ public open class MongoCluster protected constructor(private val wrapped: JMongo
* - `0` means an infinite timeout
* - `> 0` The time limit to use for the full execution of an operation.
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit, defaults to Milliseconds
* @return a new MongoCluster instance with the set time limit for operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ public class MongoCollection<T : Any>(private val wrapped: JMongoCollection<T>)
* - `0` means infinite timeout.
* - `> 0` The time limit to use for the full execution of an operation.
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @return the optional timeout duration
* @since 5.2
*/
Expand Down Expand Up @@ -176,6 +179,9 @@ public class MongoCollection<T : Any>(private val wrapped: JMongoCollection<T>)
* - `0` means an infinite timeout
* - `> 0` The time limit to use for the full execution of an operation.
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit, defaults to Milliseconds
* @return a new MongoCollection instance with the set time limit for operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public class MongoDatabase(private val wrapped: JMongoDatabase) {
* - `0` means infinite timeout.
* - `> 0` The time limit to use for the full execution of an operation.
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @return the optional timeout duration
* @since 5.2
*/
Expand Down Expand Up @@ -125,6 +128,9 @@ public class MongoDatabase(private val wrapped: JMongoDatabase) {
* - `0` means an infinite timeout
* - `> 0` The time limit to use for the full execution of an operation.
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit, defaults to Milliseconds
* @return a new MongoDatabase instance with the set time limit for operations
Expand Down
3 changes: 3 additions & 0 deletions driver-legacy/src/main/com/mongodb/MongoClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,9 @@ public Builder srvServiceName(final String srvServiceName) {
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>Note:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the rest of the API notes in this class, then we should say

Suggested change
* <p><strong>Note:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* <p>Note that this timeout does not limit socket writes, therefore there is a possibility that the

* operation might not be timed out when expected.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add this note to the MongoClientOptions.getTimeout method.

*
* @param timeoutMS the timeout in milliseconds
* @return this
* @since 5.2
Expand Down
3 changes: 3 additions & 0 deletions driver-sync/src/main/com/mongodb/client/MongoCluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ public interface MongoCluster {
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the majority of API notes in the com.mongodb.client package, we should say <p>Note: This....

The same suggestion applies to the rest of the driver-sync/src/main/com/mongodb/client files modified in the PR.

* operation might not be timed out when expected.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add this note to the MongoCluster.getTimeout method.

The same suggestion applies to the rest of the driver-sync/src/main/com/mongodb/client files modified in the PR.

*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit
* @return a new MongoCluster instance with the set time limit for the full execution of an operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ public interface MongoCollection<TDocument> {
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit
* @return a new MongoCollection instance with the set time limit for the full execution of an operation
Expand Down
3 changes: 3 additions & 0 deletions driver-sync/src/main/com/mongodb/client/MongoDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ public interface MongoDatabase {
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit
* @return a new MongoDatabase instance with the set time limit for the full execution of an operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public interface GridFSBucket {
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the majority of API notes in the com.mongodb package, we should say <p>Note: This....

The same suggestion applies to the GridFSBucket.withTimeout method.

* operation might not be timed out when expected.
*
* @param timeUnit the time unit
* @return the timeout in the given time unit
* @since 4.x
Expand Down Expand Up @@ -155,6 +158,9 @@ public interface GridFSBucket {
* <li>{@code > 0} The time limit to use for the full execution of an operation.</li>
* </ul>
*
* <p><strong>NOTE:</strong> This timeout does not limit socket writes, therefore there is a possibility that the
* operation might not be timed out when expected.
*
* @param timeout the timeout, which must be greater than or equal to 0
* @param timeUnit the time unit
* @return a new GridFSBucket instance with the set time limit for the full execution of an operation
Expand Down