Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wfe: on rate limit error, serve 500 #7796

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 7 additions & 7 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)
jsha marked this conversation as resolved.
Show resolved Hide resolved
return
}
}

Expand Down Expand Up @@ -2401,14 +2402,13 @@ func (wfe *WebFrontEndImpl) NewOrder(
}

refundLimits, err := wfe.checkNewOrderLimits(ctx, acct.ID, names, isRenewal)
if err != nil {
if err != nil && features.Get().UseKvLimitsForNewOrder {
if errors.Is(err, berrors.RateLimit) {
if features.Get().UseKvLimitsForNewOrder {
wfe.sendError(response, logEvent, probs.RateLimited(err.Error()), err)
return
}
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)
jsha marked this conversation as resolved.
Show resolved Hide resolved
return
}
}

Expand Down
Loading