[DRIVERS-1860] Avoiding a second server selection timeout when spawning mongocryptd Created: 13/Sep/19  Updated: 11/Nov/21  Resolved: 20/Oct/21

Status: Closed
Project: Drivers
Component/s: Client Side Encryption
Fix Version/s: None

Type: Spec Change Priority: Major - P3
Reporter: Robert Stam Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
Related
related to CSHARP-2768 Server selection times again out afte... Closed
is related to DRIVERS-1861 [FLE] Clarify spawning and connecting... Backlog

 Description   

The client side encryption spec says that the driver should automatically spawn mongocryptd when it gets a server selection timeout when attempting to run a command against it.

https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#managing-mongocryptd

In the C# driver we have observed that it can sometimes take mongocryptd longer than 1 second to spin up, resulting in a second non-recoverable server selection timeout.

The spec should state that when the driver automatically spawns mongocryptd it should verify that the process is up and running and accepting connections before attempting a second server selection against it.



 Comments   
Comment by Shane Harvey [ 19/Jul/21 ]

DRIVERS-1387 increased the timeout from 1 second to 10 seconds. Can we close this issue now?

Comment by Kevin Albertson [ 21/Oct/19 ]

Note, during implementation in libmongoc (CDRIVER-2875) I've seen repeated failures on a fresh reboot of my machine, due to spawning taking more than one second. I propose we bump this (perhaps 5 seconds?)

Comment by Robert Stam [ 01/Oct/19 ]

Note: as mentioned in the CSHARP ticket, mongocryptd actually seems to be launching very quickly (as expected).

So the server selection timeouts that the C# driver is seeing could be caused by hiccups in the C# driver implementation of SDAM resulting in delays in the new mongcryptd being discovered, rather than delays in the mongocryptd process itself launching and starting to wait for connections.

Generated at Thu Feb 08 08:24:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.