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 1 commit into from Apr 4, 2018
Changes from all commits
File filter

Filter by extension

Filter by extension

Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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:
var err error
connState, err = zc.Connect(gr.ctx, m)
if err == nil {
x.Printf("Error while connecting with group zero: %v", err)
delay *= 2
if delay <= maxHalfDelay {
delay *= 2
if connState.GetMember() == nil || connState.GetState() == nil {
x.Fatalf("Unable to join cluster via dgraphzero")