Skip to content

Increase Gradle wrapper networkTimeout and retry wrapper bootstrap on cache miss - #41065

Draft
damccorm wants to merge 1 commit into
masterfrom
fix/gradle-wrapper-download-retry
Draft

damccorm wants to merge 1 commit into
masterfrom
fix/gradle-wrapper-download-retry

Conversation

@damccorm

@damccorm damccorm commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes flaky Gradle wrapper download failures in Java Tests (e.g. https://github.com/apache/beam/actions/runs/42317153978 SocketTimeoutException: Read timed out, https://github.com/apache/beam/actions/runs/42045645481 HTTP response code: 504, and https://github.com/apache/beam/actions/runs/41878489533 SSLHandshakeException when downloading gradle-8.14.3-bin.zip).

  1. Increases networkTimeout in gradle/wrapper/gradle-wrapper.properties from 10000 (10s) to 60000 (60s) so downloading the 137MB Gradle distribution does not time out on brief socket read stalls.
  2. In .github/actions/gradle-command-self-hosted-action/action.yml, when the Gradle wrapper distribution is not already present in $GRADLE_USER_HOME/wrapper/dists, runs ./gradlew --version --no-daemon in a 3-attempt retry loop before executing the main Gradle command.

Verification

@damccorm

damccorm commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@github-actions github-actions Bot added build size/xs XS: <10 lines changed labels Nov 7, 2026

@github-actions github-actions Bot 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.

📋 Review Summary

This PR mitigates flaky Gradle wrapper download failures in CI by increasing networkTimeout in gradle-wrapper.properties from 10s to 60s and adding a 3-attempt bootstrap retry loop in gradle-command-self-hosted-action when the distribution cache is missing. The changes are concise, safe, and directly address the transient network errors observed in GitHub Actions runs.

🔍 General Feedback

  • Increasing networkTimeout to 60000 (60s) is well-suited for downloading the ~137MB Gradle distribution over variable CI network connections.
  • Checking for the .ok marker file before running ./gradlew --version --no-daemon avoids adding overhead when the Gradle distribution is already cached, while still allowing the main Gradle invocation to run and surface any persistent errors if all retry attempts fail.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build size/xs XS: <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant