Skip to content

Commit

Permalink
Allow entries out of order to continue
Browse files Browse the repository at this point in the history
This change makes it possible to eventually become unstuck after
encountering an out-of-order error from loki.
  • Loading branch information
lhchavez committed Oct 18, 2020
1 parent 7bd8178 commit b9a6302
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/omegaup-logslurp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ func pushRequest(
}
response, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if res.StatusCode < 200 || res.StatusCode > 299 {
if res.StatusCode == 400 && strings.Contains(string(response), "entry out of order") {
log.Info(
"entries out of order. ignoring",
"response", string(response),
)
} else if res.StatusCode < 200 || res.StatusCode > 299 {
return logEntries, errors.Errorf("failed to push to %s (%d): %q", config.URL, res.StatusCode, string(response))
}

Expand Down

0 comments on commit b9a6302

Please sign in to comment.