bazelbuild / bazelisk

A user-friendly launcher for Bazel.
Apache License 2.0
1.95k stars 300 forks source link

Allow retrying on non-HTTP errors #529

Closed afq984 closed 5 months ago

afq984 commented 5 months ago

https://github.com/bazelbuild/bazelisk/commit/787006c7de3b08807b592fe14349608cd99532b0 added support for retrying HTTP errors, this extend that to retry when an HTTP connection cannot be made.

This helps when bazelisk failes to speak HTTP:

2024/01/16 14:31:11 could not download Bazel: HTTP GET https://releases.bazel.build/7.0.0/release/bazel-7.0.0-linux-x86_64 failed: Get "https://releases.bazel.build/7.0.0/release/bazel-7.0.0-linux-x86_64": dial tcp 130.211.22.235:443: i/o timeout

Fixes: #432

afq984 commented 5 months ago

Looks like TestShouldUseExponentialBackoffIfNoRetryHeader is already flaky on master (9d3fc7d5e356071d2d40b75e69694a0c124e5e33).

go test -count=100 -run TestShouldUseExponentialBackoffIfNoRetryHeader ./httputil -v gives me 8 failures out of 100

edit: this should be fixed by https://github.com/bazelbuild/bazelisk/pull/530

fweikert commented 5 months ago

Thanks! I merged https://github.com/bazelbuild/bazelisk/pull/530, so you can rerun the tests here.