kwarter-cookbooks/mongodb — pull request #2 by dkoepke (2013-03-28 19:08:07+00:00)
Title: Retry mongo connect

Need some feedback on this before merge.

Chef only attempts to configure the replica set when a new MongoDB node is added. But it can't because `mongod` starts building its journal on first run and doesn't accept connections until the journal is built. The `configure_replicaset` method would only try to connect once and then give up if that failed.

This change just makes `configure_replicaset` retry 6 times with a 10 second delay between retries. I've tested this by standing up a fake replica set. But I'm not sure if the total delay I've introduced is long enough, or if there should be additional checks for if `mongod` is even running. Thoughts?