Ignore maxWaitTime when CSOT is enabled.#1744
Conversation
driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java
Outdated
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java
Outdated
Show resolved
Hide resolved
driver-core/src/test/functional/com/mongodb/internal/connection/DefaultConnectionPoolTest.java
Outdated
Show resolved
Hide resolved
...ync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
Show resolved
Hide resolved
driver-core/src/test/functional/com/mongodb/internal/connection/DefaultConnectionPoolTest.java
Outdated
Show resolved
Hide resolved
...ync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
Show resolved
Hide resolved
...ync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
Outdated
Show resolved
Hide resolved
...ync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
Outdated
Show resolved
Hide resolved
Add JavaDoc to StartTime. Shutdown executor properly.
...ync/src/test/functional/com/mongodb/client/AbstractClientSideOperationsTimeoutProseTest.java
Outdated
Show resolved
Hide resolved
|
The last reviewed commit is 820b131. |
…entSideOperationsTimeoutProseTest.java Co-authored-by: Valentin Kovalenko <valentin.male.kovalenko@gmail.com>
# Conflicts: # driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java DRIVERS-2985: Allow on-demand client metadata updates after MongoClient initialization. (mongodb#1798)
There was a problem hiding this comment.
Pull Request Overview
This PR implements the functionality to ignore maxWaitTime connection pool setting when Client-Side Operation Timeout (CSOT) is enabled, meaning when timeoutMS is set. When CSOT is active, the operation timeout takes precedence over the connection pool's maximum wait time.
Key changes:
- Modified connection pool logic to use operation timeout instead of maxWaitTime when CSOT is enabled
- Added comprehensive test coverage for the new behavior
- Updated timeout context methods and error handling to support the new timeout precedence
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| AbstractClientSideOperationsTimeoutProseTest.java | Added three new test cases to verify maxWaitTime is ignored when timeoutMS is set |
| ClientSideOperationTimeoutProseTest.java | Updated tearDown method signature to handle InterruptedException |
| DefaultConnectionPoolTest.java | Added test for maxWaitTime behavior and refactored Thread.sleep usage |
| DefaultConnectionPool.java | Core logic change to use operation timeout over maxWaitTime when CSOT is enabled |
| TimeoutContext.java | Modified startMaxWaitTimeout method to return operation timeout when CSOT is active |
| MongoOperationTimeoutException.java | Added @nullable annotation to constructor parameter |
| LogMessage.java | Renamed log field from WAIT_QUEUE_TIMEOUT_MS to MAX_WAIT_TIMEOUT_MS |
| Timeout.java | Added immutability documentation and import ordering fix |
| StartTime.java | Added immutability documentation |
driver-core/src/test/functional/com/mongodb/internal/connection/DefaultConnectionPoolTest.java
Show resolved
Hide resolved
driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java
Show resolved
Hide resolved
|
The merge diff is so enormous that GitHub fails to correctly display it (even the search box GitHub suggests to use to find the hidden changes does not work). So I used
given that |
JAVA-5409