Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5409

waitQueueTimeoutMs not Ignored when timeoutMS Is set

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: CSOT
    • None
    • Java Drivers

       According to the Client-Side Operations Timeout (CSOT) specification's prose tests README, operations should ignore the waitQueueTimeoutMs parameter if the timeoutMS parameter is also set. 

      However, in the current implementation, both timeoutMS and waitQueueTimeoutMs are considered, which contradicts the specification. The relevant code can be found in the TimeoutContext.java file at this location. According to the spec, only the computedServerSelectionTimeout should influence the connection checkout process when both parameters are set.

      Additionally, when the server selection timeout expires, the connection pool is expected to raise a MongoOperationTimeoutException. Instead, the current implementation throws a MongoTimeoutException, as seen in DefaultConnectionPool.java here.

      Expected Behavior:

      • When both timeoutMS and waitQueueTimeoutMs are set, waitQueueTimeoutMs should be ignored, and only timeoutMS with serverSelectionTimeout should influence the operation timeout.
      • Upon computedServerSelectionTimeout, a MongoOperationTimeoutException should be raised instead of MongoTimeoutException when timeoutMS is set.

      Actual Behavior:

      • Both timeoutMS and waitQueueTimeoutMs are considered during operations.
      • A MongoTimeoutException is thrown instead of MongoOperationTimeoutException upon computedServerSelectionTimeout when timeoutMS is set.

            Assignee:
            Unassigned Unassigned
            Reporter:
            slav.babanin@mongodb.com Slav Babanin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: