Skip to content

Commit 6403f44

Browse files
committed
Retry HTTP errors in sbt/composer image curls
The sbt and composer test images download their tools with `curl -fsSL --retry 3`. Plain --retry only retries timeouts and a few transient HTTP codes, so a single bad response from the GitHub release-asset CDN (curl exit 22) failed the image build. That evicted #1222 from the merge queue: coverage-docker (sbt) died in "Build sbt image" (run 37894279963) while every test passed. The same sbt-1.13.0.tgz URL returns 200 minutes later. --retry-all-errors makes the existing 3 retries cover HTTP errors too. The pinned sha256 checks still reject any bad payload. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZbczro7vid513B2UBrM37
1 parent c52bb9b commit 6403f44

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

‎tests/docker/Dockerfile.composer‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ RUN apt-get update \
2323

2424
RUN set -eu \
2525
&& cd /tmp \
26-
&& curl -fsSL --retry 3 -o composer.phar \
26+
&& curl -fsSL --retry 3 --retry-all-errors -o composer.phar \
2727
"https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar" \
28-
&& curl -fsSL --retry 3 -o composer.phar.sha256sum \
28+
&& curl -fsSL --retry 3 --retry-all-errors -o composer.phar.sha256sum \
2929
"https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar.sha256sum" \
3030
&& echo "$(cut -d' ' -f1 composer.phar.sha256sum) composer.phar" | sha256sum -c - \
3131
&& if [ -n "${COMPOSER_SHA256}" ]; then \

‎tests/docker/Dockerfile.sbt‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ ARG SCALA_CLI_VERSION=1.17.1
4141
ARG SCALA_CLI_SHA256_AMD64=4186bfac6552097fbfd3939bdf2ecdec1cb55baafcbf6259bef5c04e08858eb3
4242
ARG SCALA_CLI_SHA256_ARM64=a12ed53f4723f3e9312a2383e47664b4beaccf2be366cff40adf6b054426156f
4343

44+
# --retry-all-errors: plain --retry skips most HTTP errors, so one bad
45+
# response from the GitHub release-asset CDN (curl exit 22) failed the
46+
# image build and evicted a merge-queue entry (run 37894279963).
4447
RUN set -eu \
4548
&& cd /tmp \
46-
&& curl -fsSL --retry 3 -o sbt.tgz \
49+
&& curl -fsSL --retry 3 --retry-all-errors -o sbt.tgz \
4750
"https://github.com/sbt/sbt/releases/download/v${SBT_LAUNCHER_VERSION}/sbt-${SBT_LAUNCHER_VERSION}.tgz" \
4851
&& echo "${SBT_LAUNCHER_SHA256} sbt.tgz" | sha256sum -c - \
4952
&& tar -C /opt -xzf sbt.tgz \
@@ -53,15 +56,15 @@ RUN set -eu \
5356
# One launcher script per Mill line, installed as mill-<version>.
5457
RUN set -eu \
5558
&& cd /tmp \
56-
&& curl -fsSL --retry 3 -o mill-011 \
59+
&& curl -fsSL --retry 3 --retry-all-errors -o mill-011 \
5760
"https://github.com/com-lihaoyi/mill/releases/download/${MILL_011_VERSION}/${MILL_011_VERSION}" \
5861
&& echo "${MILL_011_SHA256} mill-011" | sha256sum -c - \
5962
&& install -m 0755 mill-011 "/usr/local/bin/mill-${MILL_011_VERSION}" \
60-
&& curl -fsSL --retry 3 -o mill-012 \
63+
&& curl -fsSL --retry 3 --retry-all-errors -o mill-012 \
6164
"https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/${MILL_012_VERSION}/mill-dist-${MILL_012_VERSION}-mill.sh" \
6265
&& echo "${MILL_012_SHA256} mill-012" | sha256sum -c - \
6366
&& install -m 0755 mill-012 "/usr/local/bin/mill-${MILL_012_VERSION}" \
64-
&& curl -fsSL --retry 3 -o mill-1 \
67+
&& curl -fsSL --retry 3 --retry-all-errors -o mill-1 \
6568
"https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/${MILL_1_VERSION}/mill-dist-${MILL_1_VERSION}-mill.sh" \
6669
&& echo "${MILL_1_SHA256} mill-1" | sha256sum -c - \
6770
&& install -m 0755 mill-1 "/usr/local/bin/mill-${MILL_1_VERSION}" \
@@ -74,7 +77,7 @@ RUN set -eu \
7477
arm64) arch=aarch64; sum="${SCALA_CLI_SHA256_ARM64}";; \
7578
*) echo "unsupported architecture" >&2; exit 1;; \
7679
esac \
77-
&& curl -fsSL --retry 3 -o scala-cli.gz \
80+
&& curl -fsSL --retry 3 --retry-all-errors -o scala-cli.gz \
7881
"https://github.com/VirtusLab/scala-cli/releases/download/v${SCALA_CLI_VERSION}/scala-cli-${arch}-pc-linux.gz" \
7982
&& echo "${sum} scala-cli.gz" | sha256sum -c - \
8083
&& gunzip scala-cli.gz \

0 commit comments

Comments
 (0)