diff --git a/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java b/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java index 6f0411d749c..156ae3d6eb2 100644 --- a/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java +++ b/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java @@ -172,10 +172,15 @@ public Builder keyExpiration(@Nullable final Long keyExpiration, final TimeUnit *
  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * - *

    Note: 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.

    + *

    NOTE:

    + * * * @param timeout the timeout * @param timeUnit the time unit diff --git a/driver-core/src/main/com/mongodb/ClientSessionOptions.java b/driver-core/src/main/com/mongodb/ClientSessionOptions.java index 160d16c3486..ec534574942 100644 --- a/driver-core/src/main/com/mongodb/ClientSessionOptions.java +++ b/driver-core/src/main/com/mongodb/ClientSessionOptions.java @@ -220,6 +220,11 @@ public Builder defaultTransactionOptions(final TransactionOptions defaultTransac *
  • {@code withTransaction}
  • *
  • {@code close}
  • * + * + *

    NOTE: 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 diff --git a/driver-core/src/main/com/mongodb/MongoClientSettings.java b/driver-core/src/main/com/mongodb/MongoClientSettings.java index 31206e56029..58c5599eab6 100644 --- a/driver-core/src/main/com/mongodb/MongoClientSettings.java +++ b/driver-core/src/main/com/mongodb/MongoClientSettings.java @@ -699,6 +699,9 @@ public Builder inetAddressResolver(@Nullable final InetAddressResolver inetAddre *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: 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 diff --git a/driver-core/src/main/com/mongodb/TransactionOptions.java b/driver-core/src/main/com/mongodb/TransactionOptions.java index e5f22c22def..42fb6881e94 100644 --- a/driver-core/src/main/com/mongodb/TransactionOptions.java +++ b/driver-core/src/main/com/mongodb/TransactionOptions.java @@ -292,6 +292,9 @@ public Builder maxCommitTime(@Nullable final Long maxCommitTime, final TimeUnit *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: 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 diff --git a/driver-core/src/test/resources/specifications b/driver-core/src/test/resources/specifications index 48ce8ac56d4..d5adadb2f59 160000 --- a/driver-core/src/test/resources/specifications +++ b/driver-core/src/test/resources/specifications @@ -1 +1 @@ -Subproject commit 48ce8ac56d481f611061dfabc8c0505c3fc7ef0d +Subproject commit d5adadb2f59ba5c598bc46bc93b0f1edbea9381c diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCluster.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCluster.kt index 1961989aaa2..85ffc8fced6 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCluster.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCluster.kt @@ -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. * + *

    NOTE: 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 */ @Alpha(Reason.CLIENT) @@ -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. * + *

    NOTE: 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 diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt index 9521c502460..287924afc6e 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoCollection.kt @@ -102,6 +102,9 @@ public class MongoCollection(private val wrapped: JMongoCollection) * - `0` means infinite timeout. * - `> 0` The time limit to use for the full execution of an operation. * + *

    NOTE: 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 */ @@ -176,6 +179,9 @@ public class MongoCollection(private val wrapped: JMongoCollection) * - `0` means an infinite timeout * - `> 0` The time limit to use for the full execution of an operation. * + *

    NOTE: 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 diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoDatabase.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoDatabase.kt index d59ba628008..14fd89bdb29 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoDatabase.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/MongoDatabase.kt @@ -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. * + *

    NOTE: 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 */ @@ -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. * + *

    NOTE: 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 diff --git a/driver-legacy/src/main/com/mongodb/MongoClientOptions.java b/driver-legacy/src/main/com/mongodb/MongoClientOptions.java index 1f19fba3484..59fe9753cb2 100644 --- a/driver-legacy/src/main/com/mongodb/MongoClientOptions.java +++ b/driver-legacy/src/main/com/mongodb/MongoClientOptions.java @@ -1370,6 +1370,9 @@ public Builder srvServiceName(final String srvServiceName) { *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    Note: This timeout does not limit socket writes, therefore there is a possibility that the + * operation might not be timed out when expected. + * * @param timeoutMS the timeout in milliseconds * @return this * @since 5.2 diff --git a/driver-sync/src/main/com/mongodb/client/MongoCluster.java b/driver-sync/src/main/com/mongodb/client/MongoCluster.java index e86761f8d48..3da681d1797 100644 --- a/driver-sync/src/main/com/mongodb/client/MongoCluster.java +++ b/driver-sync/src/main/com/mongodb/client/MongoCluster.java @@ -169,6 +169,9 @@ public interface MongoCluster { *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: 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 MongoCluster instance with the set time limit for the full execution of an operation. diff --git a/driver-sync/src/main/com/mongodb/client/MongoCollection.java b/driver-sync/src/main/com/mongodb/client/MongoCollection.java index 0d3248b613f..b58866f08a8 100644 --- a/driver-sync/src/main/com/mongodb/client/MongoCollection.java +++ b/driver-sync/src/main/com/mongodb/client/MongoCollection.java @@ -204,6 +204,9 @@ public interface MongoCollection { *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: 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 diff --git a/driver-sync/src/main/com/mongodb/client/MongoDatabase.java b/driver-sync/src/main/com/mongodb/client/MongoDatabase.java index 1e84a91005a..08a5d31793c 100644 --- a/driver-sync/src/main/com/mongodb/client/MongoDatabase.java +++ b/driver-sync/src/main/com/mongodb/client/MongoDatabase.java @@ -160,6 +160,9 @@ public interface MongoDatabase { *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: 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. diff --git a/driver-sync/src/main/com/mongodb/client/gridfs/GridFSBucket.java b/driver-sync/src/main/com/mongodb/client/gridfs/GridFSBucket.java index 5335ed4ce91..6df17855948 100644 --- a/driver-sync/src/main/com/mongodb/client/gridfs/GridFSBucket.java +++ b/driver-sync/src/main/com/mongodb/client/gridfs/GridFSBucket.java @@ -104,6 +104,9 @@ public interface GridFSBucket { *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: This timeout does not limit socket writes, therefore there is a possibility that the + * operation might not be timed out when expected. + * * @param timeUnit the time unit * @return the timeout in the given time unit * @since 4.x @@ -155,6 +158,9 @@ public interface GridFSBucket { *

  • {@code > 0} The time limit to use for the full execution of an operation.
  • * * + *

    NOTE: 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