Skip to content

Retry E2E image builds after Go proxy transport errors - #1076

Merged
cwilhit merged 7 commits into
mainfrom
codex/retry-e2e-image-go-downloads
Nov 12, 2026
Merged

cwilhit merged 7 commits into
mainfrom
codex/retry-e2e-image-go-downloads

Conversation

@cwilhit

@cwilhit cwilhit commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

The E2E hub and agent image build failed on PR #1075 and again on main with HTTP/2 stream errors from proxy.golang.org. In the failed main run the error came from the agent image's go build step, which also downloads modules, not only from go mod download.

  • hack/go-retry.sh wraps go mod download and go build in both deploy/Dockerfile.hub and deploy/Dockerfile.agent. A failed step is retried up to three times inside the same Docker build, and every retry uses HTTP/1.1. Only that step reruns; the module and build caches keep finished downloads and compiles. There is no error-text matching, so checksum-database (sum.golang.org) failures are covered too.
  • CI passes GO_BUILD_GODEBUG=http2client=0, so Go downloads use HTTP/1.1 from the first attempt. The E2E build step sets it for make e2e-images, and images.yaml passes it as a build arg for the published hub and agent images. The setting applies only to the wrapped go commands, so builds without it (Tilt, local) are unchanged.
  • The E2E build job timeout goes from 25 to 30 minutes to leave room for a retry.
  • The CI contract test now requires the E2E step to be exactly make e2e-images with the setting, and checks both Dockerfiles and images.yaml. New tests run the retry script: first-try success, the setting applied from the start, the switch to HTTP/1.1 on retry, and the exit code after the last attempt.

Validated with the pinned Actionlint (make verify-workflows), all 32 CI tests (hack/ci), and a local agent image build with the CI setting.

🤖 Generated with Claude Code

@cwilhit
cwilhit requested a review from mjudeikis as a code owner November 11, 2026 13:34
@cwilhit

cwilhit commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator Author

@mjudeikis-bot review

@mjudeikis mjudeikis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No Critical or Warning findings. One Note.

Checked

  • Read beyond the diff: Makefile e2e-hub-image, e2e-agent-image and e2e-images (plain docker build), the go mod download and go build steps in deploy/Dockerfile.hub and deploy/Dockerfile.agent, the other timeout-minutes values in e2e.yaml, and the verify-workflows target.
  • Correctness: the loop exits 0 on the first success and exits 1 on the third failure or on a non-matching failure. tee without -a truncates the log on each attempt, so a previous attempt's proxy error cannot trigger a retry of a later compile failure. shell: bash makes Actions run bash -eo pipefail, so make failing inside make | tee fails the pipeline and tee does not mask it. Simulated the loop with a fake proxy stream error on every attempt: it retried twice, then gave up with rc=1.
  • Concurrency, tenancy and kcp, provider contract, API/codegen/storage, portal: not applicable. The change is one CI workflow step and a timeout.
  • Security: no secrets reach the log. The mktemp file is removed by the EXIT trap. ::warning:: is a static string.
  • Timeout: worst case is 3 image builds plus 45s of sleep, covered by the raise from 25 to 35 minutes. The step is bounded.
  • Tests: no test covers the classifier. That is reasonable for a workflow step, and the PR body describes the manual simulation.
  • Commands run: make verify-workflows (pinned actionlint v1.7.7) passed with no findings; the retry simulation above.
  • Not run: the e2e suites and make build/vet/lint/unit tests, because no Go, API or provider code changed. The retry path itself needs a real Docker/proxy failure and cannot be reproduced locally.

Comment thread .github/workflows/e2e.yaml Outdated
if make e2e-images 2>&1 | tee "$build_log"; then
exit 0
fi
if [[ "$attempt" == 3 ]] || ! grep -Eq 'proxy[.]golang[.]org.*(stream error|connection reset by peer|TLS handshake timeout|unexpected EOF|i/o timeout)' "$build_log"; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: Transient-error pattern is narrow
The pattern only matches five phrases on the same line as proxy.golang.org. Other transient proxy failures, such as HTTP 5xx (502 Bad Gateway, 503 Service Unavailable), http2: server sent GOAWAY and http2: client connection lost, are not retried and fail immediately. These are the same class as the HTTP/2 stream errors this PR targets, so the next flake of that kind will still fail the job. Consider widening it:

grep -Eq 'proxy[.]golang[.]org.*(stream error|GOAWAY|client connection lost|connection reset by peer|TLS handshake timeout|unexpected EOF|i/o timeout|50[234] |Bad Gateway|Service Unavailable)' "$build_log"

cwilhit and others added 6 commits November 11, 2026 07:41
# Conflicts:
#	test/e2e/suites/agentsprovider/agents_test.go
The proxy error on main hit the agent image's go build step, not
go mod download, so a workflow-level loop that rebuilt every image
and matched proxy.golang.org error text both missed cases and cost
full rebuilds. Wrap both go commands in the hub and agent Dockerfiles
with hack/go-retry.sh, which retries the failed step in place and
switches to HTTP/1.1 on retry. CI passes GO_BUILD_GODEBUG=http2client=0
from the first attempt in both the e2e and image publishing workflows;
the setting applies only to those go commands.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cwilhit
cwilhit merged commit fdf488d into main Nov 12, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants