Skip to content

[image-builder-bob] retry on bad request #18621

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

Merged
merged 1 commit into from
Aug 30, 2023
Merged
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
4 changes: 4 additions & 0 deletions components/image-builder-bob/pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ func (proxy *Proxy) reverse(alias string) *httputil.ReverseProxy {
}
return true, nil
}
if resp.StatusCode == http.StatusBadRequest {
log.WithField("URL", resp.Request.URL.String()).Warn("bad request")
return true, nil
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The client is setup to retry up to 3 times. The default wait time in-between retries is 1s. This should help, if we're hitting transient issues that are resulting in bad requests.

Without this change, when we encounter a 400 error, we do not retry, and the image build fails.

}

return false, nil
}
Expand Down