Skip to content

Suggestion: use a more deterministic way to wait for replica set completion  #80

@zmira

Description

@zmira

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions