Repository navigation
Description
Finding (from PR #1373, merged)
pkgs/cold-store-reaper/scripts/export-turso.sh (validation added by PR #1373, still on main at lines 74–80):
DUMP_MAX_TIME="${TURSO_DUMP_MAX_TIME_SECONDS:-1800}"
case "${DUMP_MAX_TIME}" in
'' | *[!0-9]*)
echo "turso export: ERROR: TURSO_DUMP_MAX_TIME_SECONDS must be a positive integer (got '${DUMP_MAX_TIME}')" >&2
exit 1
;;
*) ;;
esacThe case rejects empty and non-digit values, but 0 is all digits and passes — despite the error message and the PR body both describing the check as validating "a positive integer". All-digit zero forms (00, 000) pass the same way.
Why it matters
The value is passed straight to curl --max-time "${DUMP_MAX_TIME}" for the /dump download. For curl, --max-time 0 means no timeout at all — the transfer runs unbounded. PR #1373 exists because a ~500 MB dump outgrew the old fixed 300 s cap; setting TURSO_DUMP_MAX_TIME_SECONDS=0 (a plausible "disable/zero" knob value, or a templating accident) silently removes the cap entirely while the operator believes a validated positive cap is in force. A stalled dump then hangs the export step indefinitely instead of failing loudly at the cap.
Suggested fix
After the digit check, reject zero explicitly (e.g. strip leading zeros and require a non-empty/non-zero remainder, or [ "$DUMP_MAX_TIME" -gt 0 ] with the digit check first so the arithmetic is safe). Add a regression test beside test_dump_max_time_env_override_is_honored covering 0 (and ideally 00) expecting exit 1 with the positive-integer error.
Provenance
Identified by pr-diff-review-b run 04a1ab0f (2026-10-27 04:18 CDT) during review of PR #1373; that run was interrupted before filing and later runs advanced the watermark past the PR. The run's own log did not survive the 2026-10-27 overload window, so the finding was re-verified firsthand against the merged diff and current main before filing (2026-10-27).
Acceptance criteria
-
TURSO_DUMP_MAX_TIME_SECONDS=0(and all-zero forms like00) is rejected with the positive-integer error and exit 1. - Non-zero positive values and the unset default (1800) behave exactly as before.
- A regression test beside
test_dump_max_time_env_override_is_honoredcovers0(and ideally00) expecting exit 1. - No other validation behavior in
export-turso.shchanges.
Activity
developing-today commentedon Oct 27, 2026
CODE-516
dezren39 commentedon Oct 27, 2026
Intake review
Fleet monitor intake pass, 2026-10-27 (repo-fleet-monitor).
Related: filed from the merged PR #1373 diff review; that PR added the validation but is not a fix for this gap. A triage task for this issue is live in the code queue (task 1437, enqueued by this monitor run after the issue was found labelled
queue/queuedwith no task).Notes: The defect is confirmed in the issue body against current main (lines 74–80): the
casepattern only excludes empty/non-digit values, so every all-zero form passes.curl --max-time 0disables the timeout entirely, which inverts the knob's purpose.Risks: Low — a rejection-path change plus a test. The main care point is ordering: keep the digit check first so the
-gt 0comparison is arithmetic-safe.Suggested approach: strip leading zeros after the digit check and require a non-zero remainder (or
[ "$DUMP_MAX_TIME" -gt 0 ]), then add the 0/00 regression cases.dezren39 commentedon Oct 31, 2026
🤖 Agent note · done
bdfde619(fresh gh api contents read, 2026-10-31):pkgs/cold-store-reaper/scripts/export-turso.sh:74-81rejects only''and non-digit values, soTURSO_DUMP_MAX_TIME_SECONDS=0and=00pass even though the error text claims a positive integer is required; line 169 feeds the value tocurl --max-time, where 0 means no timeout — a stalled ~500MB dump hangs indefinitely. The neighboring test named in the routing exists on current main:tests/test_export_turso.py:158 test_dump_max_time_env_override_is_honored.6 remaining items
chatgpt-codex-connector commentedon Oct 31, 2026
You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.
dezren39 commentedon Oct 31, 2026
🤖 Agent note · picked up
Merge pull request #3218 from developing-today/queue/4680-1428-turso-…
dezren39 commentedon Oct 31, 2026
🤖 Agent note · done