Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue retry connecting to zero instead of panicking #2307

Merged
merged 1 commit into from Apr 4, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -93,15 +93,18 @@ func StartRaftNodes(walStore *badger.ManagedDB, bindall bool) {
var connState *intern.ConnectionState
m := &intern.Member{Id: Config.RaftId, Addr: Config.MyAddr}
delay := 50 * time.Millisecond
for i := 0; i < 9; i++ { // Generous number of attempts.
maxHalfDelay := 15 * time.Second
for { // Keep on retrying. See: https://github.com/dgraph-io/dgraph/issues/2289
var err error
connState, err = zc.Connect(gr.ctx, m)
if err == nil {
break
}
x.Printf("Error while connecting with group zero: %v", err)
time.Sleep(delay)
delay *= 2
if delay <= maxHalfDelay {
delay *= 2
}
}
if connState.GetMember() == nil || connState.GetState() == nil {
x.Fatalf("Unable to join cluster via dgraphzero")
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.