Bounds the two unbounded curl fetches used by CI (flare-edge #1588).
Why
flare-edge #1545, QEMU UI gate build (run 7391, job 63953, attempt 3): "Fetch pinned QEMU BusyBox" showed the curl progress header for busybox.net and then nothing for 15 minutes until the job's 30 minute timeout. qemu_get_busybox ran curl --retry 3 --retry-delay 5 --retry-connrefused -fSL with no connect timeout, stall limit or total cap, so a connection that opens and goes silent never ends and nothing retries. build/fetch-kernel-tarball.sh had the same curl, and also wrote straight to the destination, so a failed fetch left a partial tarball that the next run took as present and rejected on its sha256.
Change
File
Change
qemu/lib.sh
per attempt: abort below 1 KiB/s for 20 s, connect timeout 20 s, cap 60 s; curl retries once, the 3-attempt loop stays; BB_FETCH_STALL_SECS, BB_FETCH_MAX_SECS, BB_FETCH_RETRY_DELAY override for tests
build/fetch-kernel-tarball.sh
connect timeout 20 s, abort below 10 KiB/s for 30 s, cap 600 s, retry 2; download to a temp file, rename on success
qemu/tests/busybox-fetch.sh
new case: real curl against a local listener that sends headers and 5 bytes, then stalls
tests/fetch-kernel-tarball/
new suite: bounded argv, no partial file after a failure, refetch after a failure, reuse of a matching tarball
.github/workflows/ci.yml
runs both suites; shellcheck covers the new one
Local gate
$ bash qemu/tests/busybox-fetch.sh # before the lib.sh fix
FAIL: a stalled download hung instead of failing (60s)
$ time bash qemu/tests/busybox-fetch.sh # after (3 more runs: 0 0 0)
busybox fetch tests passed
real 0m9.187s
$ bash tests/fetch-kernel-tarball/run-fetch-kernel-tarball-tests.sh # before
[FAIL] curl carries --connect-timeout / --speed-limit / --speed-time / --max-time
[FAIL] failed fetch: no partial tarball left
[FAIL] run after a failed fetch downloads again and passes (FATAL: tarball sha256 mismatch)
exit=1
$ bash tests/fetch-kernel-tarball/run-fetch-kernel-tarball-tests.sh # after
9 x [PASS]
fetch-kernel-tarball tests passed
$ shellcheck -x qemu/lib.sh qemu/tests/*.sh build/*.sh tests/fetch-kernel-tarball/*.sh
(clean)
Once this merges, a flare-edge rebuild submodule bump carries it (Fixes#1588 there).
Bounds the two unbounded curl fetches used by CI (flare-edge #1588).
## Why
flare-edge #1545, QEMU UI gate build (run 7391, job 63953, attempt 3): "Fetch pinned QEMU BusyBox" showed the curl progress header for busybox.net and then nothing for 15 minutes until the job's 30 minute timeout. `qemu_get_busybox` ran `curl --retry 3 --retry-delay 5 --retry-connrefused -fSL` with no connect timeout, stall limit or total cap, so a connection that opens and goes silent never ends and nothing retries. `build/fetch-kernel-tarball.sh` had the same curl, and also wrote straight to the destination, so a failed fetch left a partial tarball that the next run took as present and rejected on its sha256.
## Change
| File | Change |
|---|---|
| qemu/lib.sh | per attempt: abort below 1 KiB/s for 20 s, connect timeout 20 s, cap 60 s; curl retries once, the 3-attempt loop stays; `BB_FETCH_STALL_SECS`, `BB_FETCH_MAX_SECS`, `BB_FETCH_RETRY_DELAY` override for tests |
| build/fetch-kernel-tarball.sh | connect timeout 20 s, abort below 10 KiB/s for 30 s, cap 600 s, retry 2; download to a temp file, rename on success |
| qemu/tests/busybox-fetch.sh | new case: real curl against a local listener that sends headers and 5 bytes, then stalls |
| tests/fetch-kernel-tarball/ | new suite: bounded argv, no partial file after a failure, refetch after a failure, reuse of a matching tarball |
| .github/workflows/ci.yml | runs both suites; shellcheck covers the new one |
## Local gate
```
$ bash qemu/tests/busybox-fetch.sh # before the lib.sh fix
FAIL: a stalled download hung instead of failing (60s)
$ time bash qemu/tests/busybox-fetch.sh # after (3 more runs: 0 0 0)
busybox fetch tests passed
real 0m9.187s
$ bash tests/fetch-kernel-tarball/run-fetch-kernel-tarball-tests.sh # before
[FAIL] curl carries --connect-timeout / --speed-limit / --speed-time / --max-time
[FAIL] failed fetch: no partial tarball left
[FAIL] run after a failed fetch downloads again and passes (FATAL: tarball sha256 mismatch)
exit=1
$ bash tests/fetch-kernel-tarball/run-fetch-kernel-tarball-tests.sh # after
9 x [PASS]
fetch-kernel-tarball tests passed
$ shellcheck -x qemu/lib.sh qemu/tests/*.sh build/*.sh tests/fetch-kernel-tarball/*.sh
(clean)
```
Once this merges, a flare-edge rebuild submodule bump carries it (Fixes #1588 there).
Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
qemu_get_busybox and fetch-kernel-tarball.sh ran curl with no connect
timeout, stall limit or total cap. A server that answered and then went
silent held the flare-edge QEMU UI gate build job until its 30 minute
timeout, with no retry (flare-edge #1588, run 7391 job 63953).
- qemu/lib.sh: each attempt gives up below 1 KiB/s for 20 s, or after
60 s in all; curl retries once, the 3-attempt loop stays. Limits are
overridable through BB_FETCH_* for the tests.
- build/fetch-kernel-tarball.sh: 20 s connect timeout, abort below
10 KiB/s for 30 s, 600 s cap. The download lands in a temp file and is
renamed on success, so a failed fetch no longer leaves a partial
tarball that the next run takes as present and rejects on its sha256.
- Tests: busybox-fetch.sh serves a stalling local HTTP endpoint to the
real curl (hung for the full 60 s guard before, fails in about 9 s
after); new tests/fetch-kernel-tarball suite (bounded argv, no partial
file, refetch after a failure, reuse of a matching tarball; 6 of 9
checks red before). Both wired into CI and shellcheck.
Refs blueflare/flare-edge#1588
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG
noah
merged commit d279bc4c9f into rebuild2026-10-23 04:35:53 -06:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bounds the two unbounded curl fetches used by CI (flare-edge #1588).
Why
flare-edge #1545, QEMU UI gate build (run 7391, job 63953, attempt 3): "Fetch pinned QEMU BusyBox" showed the curl progress header for busybox.net and then nothing for 15 minutes until the job's 30 minute timeout.
qemu_get_busyboxrancurl --retry 3 --retry-delay 5 --retry-connrefused -fSLwith no connect timeout, stall limit or total cap, so a connection that opens and goes silent never ends and nothing retries.build/fetch-kernel-tarball.shhad the same curl, and also wrote straight to the destination, so a failed fetch left a partial tarball that the next run took as present and rejected on its sha256.Change
BB_FETCH_STALL_SECS,BB_FETCH_MAX_SECS,BB_FETCH_RETRY_DELAYoverride for testsLocal gate
Once this merges, a flare-edge rebuild submodule bump carries it (Fixes #1588 there).
Generated with Claude Code
https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG