Skip to content

Commit

Permalink
wfe: on rate limit error, serve 500
Browse files Browse the repository at this point in the history
This affects NewAccount and NewOrder.
  • Loading branch information
jsha committed Dec 13, 2024
1 parent 62f1a26 commit c99b657
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 1 addition & 6 deletions web/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ type RequestEvent struct {
Slug string `json:",omitempty"`
InternalErrors []string `json:",omitempty"`
Error string `json:",omitempty"`
// If there is an error checking the data store for our rate limits
// we ignore it, but attach the error to the log event for analysis.
// TODO(#7796): Treat errors from the rate limit system as normal
// errors and put them into InternalErrors.
IgnoredRateLimitError string `json:",omitempty"`
UserAgent string `json:"ua,omitempty"`
UserAgent string `json:"ua,omitempty"`
// Origin is sent by the browser from XHR-based clients.
Origin string `json:",omitempty"`
Extra map[string]interface{} `json:",omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions wfe2/wfe.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,8 @@ func (wfe *WebFrontEndImpl) NewAccount(
wfe.sendError(response, logEvent, probs.RateLimited(err.Error()), err)
return
} else {
logEvent.IgnoredRateLimitError = err.Error()
wfe.sendError(response, logEvent, web.ProblemDetailsForError(err, "While checking rate limits"), err)
return
}
}

Expand Down Expand Up @@ -2408,7 +2409,8 @@ func (wfe *WebFrontEndImpl) NewOrder(
return
}
} else {
logEvent.IgnoredRateLimitError = err.Error()
wfe.sendError(response, logEvent, web.ProblemDetailsForError(err, "While checking rate limits"), err)
return
}
}

Expand Down

0 comments on commit c99b657

Please sign in to comment.