-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Client Side Encryption
-
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); }
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); }