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

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

merged 1 commit into from
Aug 30, 2023

Conversation

kylos101
Copy link
Contributor

@kylos101 kylos101 commented Aug 30, 2023

Description

Image builds sometimes fail on push due to bad request. Users have reported that they can generally retry again w/o issue. Let's automate the retry as part of bob, to see if it helps avoid transient issues.

The default retry for RetryWaitMin is 1s.

Summary generated by Copilot

🤖 Generated by Copilot at 234746b

Fix a typo and add retry logic in proxy.go. This enhances the image builder's proxy component.

Related Issue(s)

xref: ENG-757
xref: #18611

How to test

Do an image build in preview, https://github.com/kylos101/dotfiles/ is a lovely choice.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@kylos101 kylos101 force-pushed the kylos101/retry-400 branch from 234746b to f9bf9b7 Compare August 30, 2023 01:15
@@ -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.

@kylos101 kylos101 marked this pull request as ready for review August 30, 2023 01:43
@kylos101 kylos101 requested a review from a team as a code owner August 30, 2023 01:43
@roboquat roboquat merged commit 8d0e768 into main Aug 30, 2023
@roboquat roboquat deleted the kylos101/retry-400 branch August 30, 2023 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants