Skip to content

Avoid retrying refused connections in DownloadManager - #30867

Open
jjj-n wants to merge 1 commit into
bazelbuild:masterfrom
jjj-n:codex/issue-30746-downloader-fail-fast
Open

Avoid retrying refused connections in DownloadManager#30867
jjj-n wants to merge 1 commit into
bazelbuild:masterfrom
jjj-n:codex/issue-30746-downloader-fail-fast

Conversation

@jjj-n

@jjj-n jjj-n commented Aug 26, 2026

Copy link
Copy Markdown

Description

  • Do not treat ConnectException as retryable in DownloadManager.
  • Preserve manager-level retries for other socket failures, unknown hosts, and content-length mismatches.
  • Add a regression test verifying that a suppressed ConnectException invokes the downloader only once, even when manager retries are configured.

Motivation

HttpConnector already retries connection attempts with exponential backoff. When its final ConnectException reached DownloadManager, the default five manager-level retries replayed that entire sequence, causing downloader rewrites to offline endpoints to take much longer to fail.

In an end-to-end reproduction using an offline rewritten endpoint, the failure time decreased from 83.329 seconds with Bazel 9.2.0 to 13.921 seconds with this change.

Fixes #30746.

Testing

bazel test //src/test/java/com/google/devtools/build/lib/bazel/repository/downloader:DownloaderTestSuite

The complete suite passed: 1/1 test target, with the test process completing in 138.3 seconds.

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: Downloader rewrites to endpoints that refuse connections no longer repeat the connector's full retry sequence.

@google-cla

google-cla Bot commented Aug 26, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions Bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Aug 26, 2026
@jjj-n

jjj-n commented Aug 26, 2026

Copy link
Copy Markdown
Author

@googlebot rescan

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

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloader does not fail fast on an offline localhost server.

1 participant