~waigani/juju-core/user-detail

« back to all changes in this revision

Viewing changes to cmd/jujud/bootstrap.go

[r=wallyworld] Increase mongo timeout at bootstrap

A small tweak to allow the bootstrap command
5 minutes to connnect to mongo before timing out.
This is needed because some machines are slow
and mongo does not start fast enough.

https://codereview.appspot.com/94700048/

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
        "encoding/base64"
8
8
        "fmt"
9
9
        "net"
 
10
        "time"
10
11
 
11
12
        "launchpad.net/gnuflag"
12
13
        "launchpad.net/goyaml"
164
165
        if !ok {
165
166
                return fmt.Errorf("no state info available")
166
167
        }
167
 
        dialInfo, err := state.DialInfo(info, state.DefaultDialOpts())
 
168
        // When bootstrapping, we need to allow enough time for mongo
 
169
        // to start as there's no retry loop in place.
 
170
        // 5 minutes should suffice.
 
171
        bootstrapDialOpts := state.DialOpts{Timeout: 5 * time.Minute}
 
172
        dialInfo, err := state.DialInfo(info, bootstrapDialOpts)
168
173
        if err != nil {
169
174
                return err
170
175
        }