MongoClient with mongocryptdBypassSpawn still re-executes a mark command

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 3.11.0
    • Affects Version/s: None
    • Component/s: Client Side Encryption
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      On managing mongocryptd the spec says:

      If spawning is necessary, the driver MUST spawn mongocryptd whenever server selection on the MongoClient to mongocryptd fails. If the MongoClient fails to connect after spawning, the server selection error is propagated to the user.

      If the ClientEncryption is configured with mongocryptdBypassSpawn=true, then the driver is not responsible for spawning mongocryptd. If server selection ever fails when connecting to mongocryptd, the server selection error is propagated to the user.

      However java will retry the mongocryptd command even when mongocryptdBypassSpawn=true:

                  try {
                      return executeCommand(databaseName, command);
                  } catch (MongoTimeoutException e) {
                      spawnIfNecesary();
                      return executeCommand(databaseName, command);
                  }
      

      https://github.com/mongodb/mongo-java-driver/blob/e24a0034fb00e3229bb2f867c001df24f555d7c0/driver-sync/src/main/com/mongodb/client/internal/CommandMarker.java#L78-L83

      From my reading of the spec this should be:

                  try {
                      return executeCommand(databaseName, command);
                  } catch (MongoTimeoutException e) {
                      if (processBuilder == null) {  // mongocryptdBypassSpawn=true
                          throw e;
                      }
                      spawnIfNecesary();
                      return executeCommand(databaseName, command);
                  }
      

              Assignee:
              Ross Lawley
              Reporter:
              Shane Harvey
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: