You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you know, when starting a single node replica set in MongoDbProcessStarter.Start(...), there is a 5 second wait at the end of setting up the replica set (Thread.Sleep(5000); in line 56).
I believe there is a more deterministic way to check if the replica set has been initialized.
Similar to what is being done in ProcessControl.StartAndWaitForReady(...), where a particular output message is waited for before saying the process is ready ("waiting for connections"), an output message could be waited for indicating that the replica set had been initialized.
After analyzing the output logs while setting up a replica set I noticed that the message "transition to primary complete; database writes are now permitted" is output after the replica set has completed initialization.
How do you feel about using this instead of the 5 second delay?