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

CSOT: Centralize setting maxTimeMS within CommandMessage

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Java Drivers
    • 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?

      During the CSOT implementation in CSFLE, as referenced in JAVA-4055, we encountered challenges with resetting maxTimeMS in CryptConnection for commands that are already encrypted. This issue is primarily due to the use of RawBsonCommand to enhance performance. The conversion of RawBsonCommand back to BsonCommand for adjusting maxTimeMS is considered inefficient and suboptimal for performance.

      Challenges:

      • Performance: The reliance on RawBsonCommand for performance reasons complicates the resetting of maxTimeMS on encrypted commands.
      • Duplication of logic: Tailable cursors may use maxTimeMS as maxAwaitTimeMS when timeoutMS is specified, that requires a check for the cursor type in CryptConnection—a check that has already been performed in the Operation layer. This results in duplicative logic for determining cursor type and setting maxTimeMS in both layers. However, the redundancy is minimal.

      Proposed Solution: Move the setting of maxTimeMs to the centralized lowest level, specifically to CommandMessage. 

      Acceptance criteria: 
      TBD

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

              Created:
              Updated:
              Resolved: