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

CSOT: Remove RTT check before reading response

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 5.2.0
    • Affects Version/s: None
    • Component/s: CSOT
    • None
    • Java Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Description: The current implementation of our read operations includes an unnecessary RTT check which is not mandated by the specification. This misalignment may lead to premature timeouts in read operations. The specification details are as follows:

      'After wire message construction, drivers MUST check for timeout before writing the message to the server. If the timeout has expired or the amount of time remaining is less than the selected server's minimum RTT, drivers MUST return the connection to the pool and raise a timeout exception.'

      However, for reading the response from the server, the specification states:

      'After the write is complete, drivers MUST check for timeout expiration before reading the server’s response.'

      Proposed Change: Align our implementation with the specification by removing the RTT check from the read operations. We should rely solely on the remaining timeoutMS for determining if a read operation should proceed or timeout.

      Additional Consideration: The server is already aware of the maximum allowed execution time by setting maxTimeMS. If we have sent a message to a server, there is a high likelihood that we can either read a timeout error from the server or receive the intended response. Therefore, adjusting our read timeout handling to exclude the RTT check is both safe and more aligned with the specification's intent.

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

              Created:
              Updated:
              Resolved: