Skip to content

Commit

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

* Self review: Fix typo.
  • Loading branch information
danielmai authored and manishrjain committed Nov 9, 2018
1 parent 70e07e8 commit ff1e5c3
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 ff1e5c3

Please sign in to comment.