Skip to content

Commit

Permalink
Clarify message of overloaded pending proposals for live loader. (hyp…
Browse files Browse the repository at this point in the history
…ermodeinc#2732)

* Clarify message of overloaded pending proposals for live loader.

* Self review: Fix typo.
  • Loading branch information
danielmai authored and dna2github committed Jul 19, 2019
1 parent 1b4a919 commit f317d20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dgraph/cmd/live/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion worker/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f317d20

Please sign in to comment.