-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Ignore maxWaitTime when CSOT is enabled. #1744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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 <[email protected]>
# Conflicts: # driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java DRIVERS-2985: Allow on-demand client metadata updates after MongoClient initialization. (#1798)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
JAVA-5409