From ff1e5c3d1bb88e6de97dfa74d0915bf8117e2106 Mon Sep 17 00:00:00 2001 From: Daniel Mai Date: Fri, 9 Nov 2018 03:55:58 -0800 Subject: [PATCH] Clarify message of overloaded pending proposals for live loader. (#2732) * Clarify message of overloaded pending proposals for live loader. * Self review: Fix typo. --- dgraph/cmd/live/batch.go | 4 ++-- worker/proposal.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dgraph/cmd/live/batch.go b/dgraph/cmd/live/batch.go index 47bedbc328d..6ad8dbd010b 100644 --- a/dgraph/cmd/live/batch.go +++ b/dgraph/cmd/live/batch.go @@ -140,9 +140,9 @@ func handleError(err error) { x.Fatalf(s.Message()) case strings.Contains(s.Message(), "x509"): x.Fatalf(s.Message()) - case strings.Contains(s.Message(), "Server unavailable."): + case strings.Contains(s.Message(), "Server overloaded."): dur := time.Duration(1+rand.Intn(10)) * time.Minute - fmt.Printf("Server is unavailable. Will retry after %s.", dur.Round(time.Minute)) + fmt.Printf("Server is overloaded. Will retry after %s.", dur.Round(time.Minute)) time.Sleep(dur) case err != y.ErrAborted && err != y.ErrConflict: fmt.Printf("Error while mutating %v\n", s.Message()) diff --git a/worker/proposal.go b/worker/proposal.go index ba79d6ea19f..b6d284a47a8 100644 --- a/worker/proposal.go +++ b/worker/proposal.go @@ -101,7 +101,7 @@ func uniqueKey() string { } var errInternalRetry = errors.New("Retry Raft proposal internally") -var errUnableToServe = errors.New("Server unavailable. Please retry later") +var errUnableToServe = errors.New("Server overloaded with pending proposals. Please retry later.") // proposeAndWait sends a proposal through RAFT. It waits on a channel for the proposal // to be applied(written to WAL) to all the nodes in the group.