Skip to content

[Go] Retry transient proxy.golang.org transport errors in :sdks:go:examples:wordCount - #41910

Draft
damccorm wants to merge 1 commit into
masterfrom
fix/go-wordcount-retry-proxy-errors
Draft

damccorm wants to merge 1 commit into
masterfrom
fix/go-wordcount-retry-proxy-errors

Conversation

@damccorm

@damccorm damccorm commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Note: this PR was auto-generated by tooling. Before moving it out of draft, the author has done a full review of the PR, specifically evaluating it on the following criteria:

  • The PR is an appropriate fix for the issue (e.g. we're not changing a test to avoid a bug)
  • The PR is a simple fix to the issue (e.g. we're not adding infra when we could just modify a test)
  • The PR is not covering for other problems (e.g. if we're bumping timeouts, it is not because we're covering for a performance problem)

Full details of the methodology of generation and review can be found here - https://docs.google.com/document/d/14lj7ECVov4T4EdwmIzNlWrRGE3lLDMOwX5xUMGzaLoc/edit?usp=sharing

If you have concerns with the PR or with the underlying methodology used to generate this, please comment below - they will be addressed by the author not the tooling :)

Summary

Retries transient proxy.golang.org transport/HTTP/2 errors (such as stream error: stream ID ...; INTERNAL_ERROR; received from peer and read: connection reset by peer) in :sdks:go:examples:wordCount (sdks/go/examples/build.gradle), which failed Local environment tests (Mac run local environment shell script) 3 times in 7 days.

Recent Occurrences

Root Cause

When actions/setup-go has a cold GOMODCACHE on macos-latest, :sdks:go:examples:wordCount invokes go build which downloads hundreds of Go module zips concurrently over HTTP/2 from https://proxy.golang.org. cmd/go does not retry a single HTTP/2 INTERNAL_ERROR stream reset or TCP connection reset by peer, failing the entire ./gradlew checkSetup run even though all previously fetched modules are already cached in GOMODCACHE.

Fix

  • In sdks/go/examples/build.gradle, wrap project.exec in task wordCount with up to 3 attempts (5s, 10s backoff), retrying only when stderr contains proxy.golang.org along with a transient transport error (stream error, INTERNAL_ERROR, TLS handshake timeout, connection reset, or unexpected EOF). All other errors (such as Go compilation failures) fail immediately on attempt 1, and stderr is always echoed to System.err.

Test Suite Runtime Impact

  • Affected workflow: Local environment tests (.github/workflows/local_env_tests.yml, which runs ./gradlew checkSetup → :sdks:go:examples:wordCount).
  • Happy path: 0 seconds added — when go build succeeds on attempt 1, no extra commands or sleeps run.
  • On transient proxy error: Adds 5s (attempt 2) or 15s (attempt 3) backoff plus only the remaining uncached module downloads (already-fetched modules stay in GOMODCACHE), avoiding a ~10-minute workflow failure and manual rerun. Non-proxy errors fail immediately on attempt 1.
  • Unaffected: All other CI workflows (does not modify buildSrc/, so there is no Gradle build cache invalidation).

Build/CI-only change; no production SDK code is modified.

Verification

@damccorm damccorm added the test-failure-cleanup Automated test health and flake cleanup PRs label Dec 3, 2026
@damccorm

damccorm commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@damccorm

damccorm commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing per updated test-health policy: this specific failure has only 2 occurrence(s) in the past 7 days (minimum required is >= 3 same-root-cause failures in a 7-day window, regardless of production impact). Keeping the branch so this PR can be reopened if the failure reaches >= 3 occurrences in 7 days.

@damccorm damccorm closed this Dec 3, 2026
@damccorm

damccorm commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Reopening: :sdks:go:examples:wordCount hit a 3rd transient proxy.golang.org transport failure in 7 days on master (run 47162452528, read: connection reset by peer, following 47111889160 and 47137555748), meeting the >= 3 same-root-cause failures in 7 days threshold.

@damccorm damccorm reopened this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-failure-cleanup Automated test health and flake cleanup PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant