Skip to content

Commit 234746b

Browse files
committed
[image-builder-bob] retry on bad request
1 parent edca0d5 commit 234746b

File tree

1 file changed

+6
-1
lines changed
  • components/image-builder-bob/pkg/proxy

1 file changed

+6
-1
lines changed

components/image-builder-bob/pkg/proxy/proxy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ func (proxy *Proxy) reverse(alias string) *httputil.ReverseProxy {
168168

169169
client := retryablehttp.NewClient()
170170
client.RetryMax = 3
171-
client.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) {
171+
client.
172+
client.CheckRetry = func(ctx context.Context, resp *http.Response, err error) (bool, error) {
172173
if err != nil {
173174
log.WithError(err).Warn("saw error during CheckRetry")
174175
return false, err
@@ -185,6 +186,10 @@ func (proxy *Proxy) reverse(alias string) *httputil.ReverseProxy {
185186
}
186187
return true, nil
187188
}
189+
if resp.StatusCode == http.StatusBadRequest {
190+
log.WithField("URL", resp.Request.URL.String()).Warn("bad request")
191+
return true, nil
192+
}
188193

189194
return false, nil
190195
}

0 commit comments

Comments
 (0)