From dbe2ee343ba8642ffc9b1009e9d550b0019d5b29 Mon Sep 17 00:00:00 2001 From: Daniel Mai Date: Tue, 6 Nov 2018 18:14:14 -0800 Subject: [PATCH 1/2] Clarify message of overloaded pending proposals for live loader. --- 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..37015a3b0a9 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 is 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 bb78e23b9f1..d99b7a8d79f 100644 --- a/worker/proposal.go +++ b/worker/proposal.go @@ -94,7 +94,7 @@ func (rl *rateLimiter) decr(retry int) { } 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. From 821d81812514cd496221a72914607f56144cc020 Mon Sep 17 00:00:00 2001 From: Daniel Mai Date: Tue, 6 Nov 2018 18:38:31 -0800 Subject: [PATCH 2/2] Self review: Fix typo. --- dgraph/cmd/live/batch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dgraph/cmd/live/batch.go b/dgraph/cmd/live/batch.go index 37015a3b0a9..6ad8dbd010b 100644 --- a/dgraph/cmd/live/batch.go +++ b/dgraph/cmd/live/batch.go @@ -140,7 +140,7 @@ func handleError(err error) { x.Fatalf(s.Message()) case strings.Contains(s.Message(), "x509"): x.Fatalf(s.Message()) - case strings.Contains(s.Message(), "Server is overloaded."): + case strings.Contains(s.Message(), "Server overloaded."): dur := time.Duration(1+rand.Intn(10)) * time.Minute fmt.Printf("Server is overloaded. Will retry after %s.", dur.Round(time.Minute)) time.Sleep(dur)