Retry and bound the fj downloads #1

Merged
stephen merged 6 commits from rel-cl/plat-924-curl-retry into main 2026-11-22 20:37:08 +00:00
Owner

Classification: environment (the forge answered 504 for several minutes around 06:30 UTC on 2026-11-22; flux's audit lost a read in the same window) with a missing defence here. Run 506 of fjord-docs' fj reference job: 'downloading fj-v0.8.4-linux-x86_64.tar.gz ... curl: (22) The requested URL returned error: 504', after 137 s, then 'exitcode 22'. curl was called without retries or limits.

Fix (scripts/fetch.sh, sourced by setup.sh):

  • Retries: each ask is made once, then retried up to 3 times (5 s apart) on no answer at all (a timeout, a reset, a short body) and on HTTP 408, 429, 500, 502, 503 and 504. Any other status (a 4xx, and also 501, 505, 507 and the other 5xx) ends the ask at once: the policy is deliberately this narrow.
  • Bounds: a transfer that moves under 1 byte a second for 30 s is a stall and is cut off (a hung forge is given up on fast); a try is capped at 300 s; the whole fetch (anonymous ask, token fallback, pauses) has one deadline of 900 s, the anonymous ask getting half when there is a token. A slow download that keeps moving is not cut short by a share of that deadline.
  • Each try writes its own file, so the answer is one whole response; a failed copy of it fails the fetch; no Bash 4 constructs (checked in 3.2.57).
  • Tests (tests/fetch.sh, real curl against a local server): 503, 503, 200; recovery on the fourth request; 404 and 507 not retried; 504 forever is four requests; a hung forge with a token is asked eight times inside the deadline; a slow trickling body succeeds in one request; a short body then a whole one; the token only after the anonymous ask fails; an unwritable output fails. The offline suite's fake curl is updated to the new flags. PLAT-924, PLAT-921.
Classification: environment (the forge answered 504 for several minutes around 06:30 UTC on 2026-11-22; flux's audit lost a read in the same window) with a missing defence here. Run 506 of fjord-docs' fj reference job: 'downloading fj-v0.8.4-linux-x86_64.tar.gz ... curl: (22) The requested URL returned error: 504', after 137 s, then 'exitcode 22'. curl was called without retries or limits. Fix (scripts/fetch.sh, sourced by setup.sh): - Retries: each ask is made once, then retried up to 3 times (5 s apart) on no answer at all (a timeout, a reset, a short body) and on HTTP 408, 429, 500, 502, 503 and 504. Any other status (a 4xx, and also 501, 505, 507 and the other 5xx) ends the ask at once: the policy is deliberately this narrow. - Bounds: a transfer that moves under 1 byte a second for 30 s is a stall and is cut off (a hung forge is given up on fast); a try is capped at 300 s; the whole fetch (anonymous ask, token fallback, pauses) has one deadline of 900 s, the anonymous ask getting half when there is a token. A slow download that keeps moving is not cut short by a share of that deadline. - Each try writes its own file, so the answer is one whole response; a failed copy of it fails the fetch; no Bash 4 constructs (checked in 3.2.57). - Tests (tests/fetch.sh, real curl against a local server): 503, 503, 200; recovery on the fourth request; 404 and 507 not retried; 504 forever is four requests; a hung forge with a token is asked eight times inside the deadline; a slow trickling body succeeds in one request; a short body then a whole one; the token only after the anonymous ask fails; an unwritable output fails. The offline suite's fake curl is updated to the new flags. PLAT-924, PLAT-921.
Retry and bound the fj downloads (PLAT-924)
All checks were successful
test / unit (pull_request) Successful in 1m32s
test / e2e (pull_request) Successful in 1m40s
3363b717a2
fjord-docs' daily fj reference run 506 (2026-11-22) died on one 504 after 137 s while downloading the fj binary. curl now retries 3 times, 5 s apart, on a timeout or a 5xx, with a 20 s connect and a 300 s total limit.

Signed-off-by: Stephen Way <stephen@rasterstate.com>
gerri requested changes 2026-11-22 17:56:51 +00:00
Dismissed
gerri left a comment

Automated Codex review (read-only) of head 3363b717a2.

  • Medium scripts/setup.sh:27: The promised download deadline must bound the whole fetch. --max-time 300 resets for every retry. With a workflow token, the anonymous request and token fallback can each take four 300-second attempts, plus retry delays. A hung forge can therefore hold a single fetch for over 40 minutes, rather than the 300 seconds stated in the changelog. This affects the default latest lookup and both downloads during the same kind of forge outage this PR addresses. Enforce a total deadline across retries and the token fallback, and test that deadline.

  • Low, edge case, scripts/setup.sh:36: A successful retry must supply one complete response. The latest-version response goes to a pipe, so curl cannot discard bytes already written by a timed-out attempt before retrying. A partial JSON response followed by a successful response can be combined and parsed as the wrong tag or fail resolution. The asset and checksum paths use output files, so this pipe issue is specific to version lookup. Fetch the lookup into a temporary file that is reset between attempts, then parse only the successful response.

  • Low, edge case, scripts/setup.sh:27: Retry behavior must match the documented status codes. Curl retries HTTP 500, 502, 503 and 504, but not every 5xx as the PR body claims. For example, repeated 507 responses receive no retry. Either implement the broader policy or narrow the claim.

  • Low, edge case, tests/run.sh:118: Tests must exercise the failure behavior they claim. Both new checks inspect arguments passed to a fake curl that always succeeds. They cannot establish that a transient failure is retried, that a permanent failure exits, or that the total deadline holds. Exercise the production fetch through a controlled HTTP server with transient and permanent responses, covering the version lookup, asset, checksum, and token fallback.

BLOCKING: 1

Reviewed head 3363b717a2 at 2026-11-22T17:56:50Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head 3363b717a2404aa1bde7f202625f2ca81944b857. - **Medium** [scripts/setup.sh:27](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/setup.sh:27): **The promised download deadline must bound the whole fetch.** `--max-time 300` resets for every retry. With a workflow token, the anonymous request and token fallback can each take four 300-second attempts, plus retry delays. A hung forge can therefore hold a single fetch for over 40 minutes, rather than the 300 seconds stated in the changelog. This affects the default latest lookup and both downloads during the same kind of forge outage this PR addresses. Enforce a total deadline across retries and the token fallback, and test that deadline. - **Low**, edge case, [scripts/setup.sh:36](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/setup.sh:36): **A successful retry must supply one complete response.** The latest-version response goes to a pipe, so curl cannot discard bytes already written by a timed-out attempt before retrying. A partial JSON response followed by a successful response can be combined and parsed as the wrong tag or fail resolution. The asset and checksum paths use output files, so this pipe issue is specific to version lookup. Fetch the lookup into a temporary file that is reset between attempts, then parse only the successful response. - **Low**, edge case, [scripts/setup.sh:27](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/setup.sh:27): **Retry behavior must match the documented status codes.** Curl retries HTTP 500, 502, 503 and 504, but not every 5xx as the PR body claims. For example, repeated 507 responses receive no retry. Either implement the broader policy or narrow the claim. - **Low**, edge case, [tests/run.sh:118](/home/dev/work/reviews/rasterstate-setup-fj-action-1/tests/run.sh:118): **Tests must exercise the failure behavior they claim.** Both new checks inspect arguments passed to a fake curl that always succeeds. They cannot establish that a transient failure is retried, that a permanent failure exits, or that the total deadline holds. Exercise the production fetch through a controlled HTTP server with transient and permanent responses, covering the version lookup, asset, checksum, and token fallback. BLOCKING: 1 --- Reviewed head 3363b717a2404aa1bde7f202625f2ca81944b857 at 2026-11-22T17:56:50Z by codex exec (read-only sandbox).
fetch: one deadline for the whole fetch, one response per try, tests against a real server (gerri)
Some checks failed
test / unit (pull_request) Failing after 12s
test / e2e (pull_request) Successful in 16s
7a063de077
Signed-off-by: Stephen Way <stephen@rasterstate.com>
Author
Owner

gerri, all four addressed (two pushes: the first went out with the offline suite's fake curl still writing the version lookup to stdout instead of its -o file, so run.sh failed on it; the second is that fix, and the whole suite passes).

  • Medium, one deadline: curl's --retry restarted --max-time on every try. The retries are now a loop in scripts/fetch.sh with one deadline for the whole fetch, both asks (anonymous, then the token) and every pause: each curl gets only the time left, and no try starts once it is gone. SF_FETCH_DEADLINE (300 s), SF_FETCH_TRIES (3), SF_FETCH_PAUSE (5). Test: a server that never answers, three tries, a token fallback and a 4 s deadline fails after 4 s.
  • Low, one complete response: every try writes its own file (reset first), and the answer is that file only after a 2xx, so a try cut short can never be joined to the next; the version lookup no longer pipes curl. Test: a body of 8 bytes of a 100-byte answer, then the whole one, gives exactly the whole one.
  • Low, the status codes: the claim is narrowed to what is done and tested: no answer at all, and 408, 429, 500, 502, 503, 504. Any other status (404, 507, ...) ends the ask at once. Tests: 507 and 404 are one request each.
  • Low, the tests: scripts/fetch.sh is exercised with real curl against a local server (tests/server.py, logged requests): 503, 503, then 200 (three requests); 404 (one, fails); 504 forever (three, fails); the hung forge and the deadline; the short body; the token sent only after the anonymous ask fails and never to a public answer; output to a file. The two argument-inspection checks are gone.
gerri, all four addressed (two pushes: the first went out with the offline suite's fake curl still writing the version lookup to stdout instead of its -o file, so run.sh failed on it; the second is that fix, and the whole suite passes). - Medium, one deadline: curl's --retry restarted --max-time on every try. The retries are now a loop in scripts/fetch.sh with one deadline for the whole fetch, both asks (anonymous, then the token) and every pause: each curl gets only the time left, and no try starts once it is gone. SF_FETCH_DEADLINE (300 s), SF_FETCH_TRIES (3), SF_FETCH_PAUSE (5). Test: a server that never answers, three tries, a token fallback and a 4 s deadline fails after 4 s. - Low, one complete response: every try writes its own file (reset first), and the answer is that file only after a 2xx, so a try cut short can never be joined to the next; the version lookup no longer pipes curl. Test: a body of 8 bytes of a 100-byte answer, then the whole one, gives exactly the whole one. - Low, the status codes: the claim is narrowed to what is done and tested: no answer at all, and 408, 429, 500, 502, 503, 504. Any other status (404, 507, ...) ends the ask at once. Tests: 507 and 404 are one request each. - Low, the tests: scripts/fetch.sh is exercised with real curl against a local server (tests/server.py, logged requests): 503, 503, then 200 (three requests); 404 (one, fails); 504 forever (three, fails); the hung forge and the deadline; the short body; the token sent only after the anonymous ask fails and never to a public answer; output to a file. The two argument-inspection checks are gone.
tests: the fake curl writes the version lookup to its -o file
All checks were successful
test / e2e (pull_request) Successful in 10s
test / unit (pull_request) Successful in 12s
f568978191
Signed-off-by: Stephen Way <stephen@rasterstate.com>
gerri requested changes 2026-11-22 18:46:26 +00:00
Dismissed
gerri left a comment

Automated Codex review (read-only) of head f568978191.

  • High scripts/fetch.sh:18: Invariant: supported platforms must be able to fetch releases. On macOS runners using the system Bash 3.2, set -u treats the empty auth array expansion as an unbound variable. Every fetch starts anonymously, so the version lookup and both downloads fail before curl runs. This breaks the action on its supported Darwin platforms. Guard the empty array expansion or construct the anonymous and authenticated curl calls without expanding an empty array, and test with Bash 3.2.

  • Medium scripts/fetch.sh:18: Invariant: a retryable timeout gets another attempt within the fetch budget. The first curl receives the entire remaining 300-second deadline. If the forge accepts a connection but stops responding, that attempt consumes the budget, leaving no time for a retry or token fallback. A transient stall can therefore fail a real job even if the forge recovers immediately after the timeout, contrary to this PR’s stated timeout retry behavior. Reserve time for subsequent attempts and the fallback, and assert the request count in the hang test. The same helper affects the version lookup and both downloads.

BLOCKING: 2

Reviewed head f568978191 at 2026-11-22T18:46:25Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head f56897819146da616a786ce10ca2c0900bd98ba3. - **High** [scripts/fetch.sh:18](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:18): **Invariant: supported platforms must be able to fetch releases.** On macOS runners using the system Bash 3.2, `set -u` treats the empty `auth` array expansion as an unbound variable. Every fetch starts anonymously, so the version lookup and both downloads fail before curl runs. This breaks the action on its supported Darwin platforms. Guard the empty array expansion or construct the anonymous and authenticated curl calls without expanding an empty array, and test with Bash 3.2. - **Medium** [scripts/fetch.sh:18](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:18): **Invariant: a retryable timeout gets another attempt within the fetch budget.** The first curl receives the entire remaining 300-second deadline. If the forge accepts a connection but stops responding, that attempt consumes the budget, leaving no time for a retry or token fallback. A transient stall can therefore fail a real job even if the forge recovers immediately after the timeout, contrary to this PR’s stated timeout retry behavior. Reserve time for subsequent attempts and the fallback, and assert the request count in the hang test. The same helper affects the version lookup and both downloads. BLOCKING: 2 --- Reviewed head f56897819146da616a786ce10ca2c0900bd98ba3 at 2026-11-22T18:46:25Z by codex exec (read-only sandbox).
fetch: no empty array under set -u (macOS Bash 3.2), and each try gets a share of the deadline (gerri)
All checks were successful
test / e2e (pull_request) Successful in 33s
test / unit (pull_request) Successful in 48s
dd33409bbb
Signed-off-by: Stephen Way <stephen@rasterstate.com>
Author
Owner

gerri, both fixed in one push.

  • High, Bash 3.2: the empty auth array was an unbound variable under set -u on the Bash 3.2 of macOS, so every anonymous fetch died before curl ran. fetch.sh no longer uses an array: the header is expanded as ${hdr:+-H "$hdr"}. I checked it in a real bash 3.2.57 (the bash:3.2 image): the old form prints 'a[@]: unbound variable'; the new one gives 1 argument without a token and 3 with one; and fetch.sh itself, sourced under set -u in 3.2.57 with a stub curl, returns the body anonymously and with a token. tests/fetch.sh also fetches anonymously under set -u in whatever bash runs it.
  • Medium, a stall must leave time: the first try no longer gets all that is left. Each try gets an equal share of what is left of its ask (left / tries still to make, at least 1 s), and when there is a token the anonymous ask gets half of SF_FETCH_DEADLINE, so a stall leaves time for the retries and for the token fallback. The hang test now asserts the request counts: with a 9 s deadline and a token, a hung forge is asked 6 times (three anonymous, three with the token) and the fetch ends at 9 s; with no token and 6 s, three times. 12 fetch checks pass and the whole suite exits 0 (I ran it before pushing this time).
gerri, both fixed in one push. - High, Bash 3.2: the empty auth array was an unbound variable under set -u on the Bash 3.2 of macOS, so every anonymous fetch died before curl ran. fetch.sh no longer uses an array: the header is expanded as ${hdr:+-H "$hdr"}. I checked it in a real bash 3.2.57 (the bash:3.2 image): the old form prints 'a[@]: unbound variable'; the new one gives 1 argument without a token and 3 with one; and fetch.sh itself, sourced under set -u in 3.2.57 with a stub curl, returns the body anonymously and with a token. tests/fetch.sh also fetches anonymously under set -u in whatever bash runs it. - Medium, a stall must leave time: the first try no longer gets all that is left. Each try gets an equal share of what is left of its ask (left / tries still to make, at least 1 s), and when there is a token the anonymous ask gets half of SF_FETCH_DEADLINE, so a stall leaves time for the retries and for the token fallback. The hang test now asserts the request counts: with a 9 s deadline and a token, a hung forge is asked 6 times (three anonymous, three with the token) and the fetch ends at 9 s; with no token and 6 s, three times. 12 fetch checks pass and the whole suite exits 0 (I ran it before pushing this time).
gerri requested changes 2026-11-22 19:19:25 +00:00
Dismissed
gerri left a comment

Automated Codex review (read-only) of head dd33409bbb.

  • Medium: scripts/fetch.sh: Invariant: retry behavior must match the promised recovery policy. The PR promises three retries, but the loop makes three total attempts, allowing only two retries per anonymous or authenticated request. With the default configuration, a forge returning three consecutive 504s and then recovering will still fail the version lookup or download instead of making the promised fourth request. This is directly in the PR’s outage-recovery scope. Make the initial attempt plus three retries, and test recovery on the fourth request.

  • Low, edge case: scripts/fetch.sh: Invariant: a failed output write must not be reported as a successful fetch. fetch ignores a failed cat and returns success after removing the temporary file. For example, a full runner filesystem during the copy can leave an incomplete asset or checksum file while reporting success. All three callers use this helper. Check the copy result, clean up, and return failure if it fails.

BLOCKING: 1

Reviewed head dd33409bbb at 2026-11-22T19:19:24Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head dd33409bbb4088921f1e302a6189e94debf8cdb2. - **Medium**: [scripts/fetch.sh](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:13): **Invariant: retry behavior must match the promised recovery policy.** The PR promises three retries, but the loop makes three total attempts, allowing only two retries per anonymous or authenticated request. With the default configuration, a forge returning three consecutive 504s and then recovering will still fail the version lookup or download instead of making the promised fourth request. This is directly in the PR’s outage-recovery scope. Make the initial attempt plus three retries, and test recovery on the fourth request. - **Low**, edge case: [scripts/fetch.sh](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:41): **Invariant: a failed output write must not be reported as a successful fetch.** `fetch` ignores a failed `cat` and returns success after removing the temporary file. For example, a full runner filesystem during the copy can leave an incomplete asset or checksum file while reporting success. All three callers use this helper. Check the copy result, clean up, and return failure if it fails. BLOCKING: 1 --- Reviewed head dd33409bbb4088921f1e302a6189e94debf8cdb2 at 2026-11-22T19:19:24Z by codex exec (read-only sandbox).
fetch: the request and three retries, and a failed copy fails the fetch (gerri)
All checks were successful
test / e2e (pull_request) Successful in 17s
test / unit (pull_request) Successful in 32s
0180490197
Signed-off-by: Stephen Way <stephen@rasterstate.com>
Author
Owner

gerri, both fixed in one push (0180490; the first attempt to push failed on an ssh error and nothing reached the remote, so this is the one push).

  • Medium, three retries means four requests: the loop made three requests in all. It is now the request and up to three retries per ask (SF_FETCH_RETRIES, default 3; the old SF_FETCH_TRIES is gone), with the deadline shares divided over four. Tests: 504, 504, 504, then 200 recovers on the fourth request (/recover4, four requests logged); 504 forever is four requests then failure; a hung forge with a token and an 8 s deadline is asked 8 times (four anonymous, four with the token), without a token four; 503, 503, 200 is still three.
  • Low, a failed write: fetch checked nothing after the copy. It now fails when the copy fails (a full disk, a directory that is not there, a closed pipe), removes the partial file, says so on stderr and returns 1. Tests: an output in a missing directory fails, /dev/full fails (where it exists), and a good write still works; also run under a real bash 3.2.57 with a stub curl (anonymous, token, and the unwritable output). The whole suite exits 0 (16 fetch checks, 11 in run.sh); CHANGELOG says the request then up to three retries.
gerri, both fixed in one push (0180490; the first attempt to push failed on an ssh error and nothing reached the remote, so this is the one push). - Medium, three retries means four requests: the loop made three requests in all. It is now the request and up to three retries per ask (SF_FETCH_RETRIES, default 3; the old SF_FETCH_TRIES is gone), with the deadline shares divided over four. Tests: 504, 504, 504, then 200 recovers on the fourth request (/recover4, four requests logged); 504 forever is four requests then failure; a hung forge with a token and an 8 s deadline is asked 8 times (four anonymous, four with the token), without a token four; 503, 503, 200 is still three. - Low, a failed write: fetch checked nothing after the copy. It now fails when the copy fails (a full disk, a directory that is not there, a closed pipe), removes the partial file, says so on stderr and returns 1. Tests: an output in a missing directory fails, /dev/full fails (where it exists), and a good write still works; also run under a real bash 3.2.57 with a stub curl (anonymous, token, and the unwritable output). The whole suite exits 0 (16 fetch checks, 11 in run.sh); CHANGELOG says the request then up to three retries.
gerri requested changes 2026-11-22 19:56:59 +00:00
Dismissed
gerri left a comment

Automated Codex review (read-only) of head 0180490197.

  • Medium scripts/fetch.sh:17: A healthy response must have enough time to complete within the advertised timeout. With the usual workflow token present, the first anonymous attempt gets only 37 seconds, and subsequent attempts get similar or shorter limits. A Forgejo release download that takes 40 seconds on a slow runner or during degraded service will repeatedly time out, even though it would complete within the PR body’s stated 300-second --max-time. This affects the version lookup and both downloads, and belongs in this PR because the new timeout causes jobs that previously succeeded to fail. Allocate a sufficient per-attempt budget while retaining a bounded total deadline, and test a slow but successful response through the setup path.

  • Low scripts/fetch.sh:24: Edge case. Retry policy and user-facing claims should agree. The PR body says all 5xx responses are retried, but 501, 505, 507 and other unlisted 5xx responses immediately end an ask. For example, a temporary 507 from a private mirror gets no retry. Either retry all 5xx responses or correct the PR body to state the deliberately narrower policy.

BLOCKING: 1

Reviewed head 0180490197 at 2026-11-22T19:56:57Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head 0180490197dabf48c8fffe1be637629f9867e622. - **Medium** [scripts/fetch.sh:17](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:17): A healthy response must have enough time to complete within the advertised timeout. With the usual workflow token present, the first anonymous attempt gets only 37 seconds, and subsequent attempts get similar or shorter limits. A Forgejo release download that takes 40 seconds on a slow runner or during degraded service will repeatedly time out, even though it would complete within the PR body’s stated 300-second `--max-time`. This affects the version lookup and both downloads, and belongs in this PR because the new timeout causes jobs that previously succeeded to fail. Allocate a sufficient per-attempt budget while retaining a bounded total deadline, and test a slow but successful response through the setup path. - **Low** [scripts/fetch.sh:24](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:24): **Edge case.** Retry policy and user-facing claims should agree. The PR body says all 5xx responses are retried, but 501, 505, 507 and other unlisted 5xx responses immediately end an ask. For example, a temporary 507 from a private mirror gets no retry. Either retry all 5xx responses or correct the PR body to state the deliberately narrower policy. BLOCKING: 1 --- Reviewed head 0180490197dabf48c8fffe1be637629f9867e622 at 2026-11-22T19:56:57Z by codex exec (read-only sandbox).
fetch: a stall limit and a per-try cap instead of shares of the deadline (gerri)
All checks were successful
test / e2e (pull_request) Successful in 10s
test / unit (pull_request) Successful in 27s
ae140bbb71
Signed-off-by: Stephen Way <stephen@rasterstate.com>
Author
Owner

gerri, both fixed in one push (ae140bb).

  • Medium, a slow healthy download must complete: you are right: dividing the deadline into per-try shares gave a first anonymous try with a token 37 s, which a 40 s download would have exceeded, where before this PR there was no limit at all. The shares are gone. A hung forge is now caught by a stall limit (curl --speed-limit 1 --speed-time 30: under a byte a second for 30 s), a try may run up to SF_FETCH_ATTEMPT (300 s) as long as it keeps moving, and the whole fetch has one deadline of 900 s (SF_FETCH_DEADLINE), the anonymous ask getting half when there is a token. Tests through the same fetch the setup path uses: a body that trickles in over four seconds, with a token and a 12 s deadline (so the anonymous ask has 6 s, which the old shares would have cut to 1.5 s), succeeds in one request; a hung forge with a 1 s stall limit and a 30 s deadline is asked eight times (four anonymous, four with the token) and ends in 8 s; with a 5 s deadline it still ends in about 4 s.
  • Low, the 5xx claim: I narrowed the claim, not the policy: the PR body, the CHANGELOG and the header of fetch.sh now name the codes (408, 429, 500, 502, 503, 504, and no answer at all) and say that every other status, 501, 505 and 507 included, ends the ask at once. A 507 test already asserts one request.
    The whole suite exits 0 (17 fetch checks and the 11 of run.sh); fetch also runs under a real bash 3.2.57 with a stub curl.
gerri, both fixed in one push (ae140bb). - Medium, a slow healthy download must complete: you are right: dividing the deadline into per-try shares gave a first anonymous try with a token 37 s, which a 40 s download would have exceeded, where before this PR there was no limit at all. The shares are gone. A hung forge is now caught by a stall limit (curl --speed-limit 1 --speed-time 30: under a byte a second for 30 s), a try may run up to SF_FETCH_ATTEMPT (300 s) as long as it keeps moving, and the whole fetch has one deadline of 900 s (SF_FETCH_DEADLINE), the anonymous ask getting half when there is a token. Tests through the same fetch the setup path uses: a body that trickles in over four seconds, with a token and a 12 s deadline (so the anonymous ask has 6 s, which the old shares would have cut to 1.5 s), succeeds in one request; a hung forge with a 1 s stall limit and a 30 s deadline is asked eight times (four anonymous, four with the token) and ends in 8 s; with a 5 s deadline it still ends in about 4 s. - Low, the 5xx claim: I narrowed the claim, not the policy: the PR body, the CHANGELOG and the header of fetch.sh now name the codes (408, 429, 500, 502, 503, 504, and no answer at all) and say that every other status, 501, 505 and 507 included, ends the ask at once. A 507 test already asserts one request. The whole suite exits 0 (17 fetch checks and the 11 of run.sh); fetch also runs under a real bash 3.2.57 with a stub curl.
gerri approved these changes 2026-11-22 20:26:36 +00:00
gerri left a comment

Automated Codex review (read-only) of head ae140bbb71.

  • Low (scripts/fetch.sh:20, tests/fetch.sh:62): Edge case. The stated invariant is that a progressing download is limited by the per-try cap and total deadline, not by the anonymous share. With a token, an anonymous attempt that consumes 300 seconds leaves roughly 145 seconds of its 450-second share after the pause. A second, healthy download requiring 200 seconds is then cut off by that share. This affects the version lookup and both downloads. The slow-download test finishes within the anonymous share, so it does not test the stated invariant. Reserve time for token fallback without cutting short an already progressing attempt, and test a download that crosses the share boundary.

BLOCKING: 0

Reviewed head ae140bbb71 at 2026-11-22T20:26:36Z by codex exec (read-only sandbox).

Automated Codex review (read-only) of head ae140bbb71c977e79d9ea4b75a1b22ef395064bc. - **Low** ([scripts/fetch.sh:20](/home/dev/work/reviews/rasterstate-setup-fj-action-1/scripts/fetch.sh:20), [tests/fetch.sh:62](/home/dev/work/reviews/rasterstate-setup-fj-action-1/tests/fetch.sh:62)): **Edge case.** The stated invariant is that a progressing download is limited by the per-try cap and total deadline, not by the anonymous share. With a token, an anonymous attempt that consumes 300 seconds leaves roughly 145 seconds of its 450-second share after the pause. A second, healthy download requiring 200 seconds is then cut off by that share. This affects the version lookup and both downloads. The slow-download test finishes within the anonymous share, so it does not test the stated invariant. Reserve time for token fallback without cutting short an already progressing attempt, and test a download that crosses the share boundary. BLOCKING: 0 --- Reviewed head ae140bbb71c977e79d9ea4b75a1b22ef395064bc at 2026-11-22T20:26:36Z by codex exec (read-only sandbox).
stephen referenced this pull request from a commit 2026-11-22 20:37:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rasterstate/setup-fj-action!1
No description provided.