Fail-fast Forgejo timeouts: --connect-timeout + tighter --max-time #396
No reviewers
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Total time spent: 22 seconds
Due date
igor
22 seconds
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor!396
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/forgejo-connect-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #395 — a few-second git.sherver.org blip hung a tick ~30s then died (curl exit 28), tripping a false
task failhealth page.Root cause:
lib/forgejo.shcurl wrappers used--max-time 30with no--connect-timeout, so a briefly-unreachable server stalled a call for the full max-time before failing. Under the tick's errexit that aborted the tick; thecleanup()trap firedhc_ping task fail.Fix: add
--connect-timeout 5and tighten--max-time30 → 15 across the Forgejo curl paths (_fj,_forgejo_post_reviewers; the image upload keeps--max-time 60but gains the connect-timeout). A blip now rides through or fails in ~5s instead of ~30s — keeps the agent moving. Values hardcoded (one operator).Not aggressiveness: validation git-fetches are cached 15 min/repo; a tick makes only ~10-30 small API calls. The problem was timeout length, not call volume.
Test: shims
curland asserts_fjpasses the fail-fast flags — fails without them (verified).make test+ shellcheck green.Follow-up (noted in #395, not here): unguarded best-effort recovery-sweep callers still propagate a transient failure fatally, so a blip can still page — just faster; worth making those best-effort. The co-located
basenamereaper bug rides this path too — PR #393.Closes #395
🤖 Review —
APPROVE(automated)CI for
c3002edc: successAdds
--connect-timeout 5and tightens--max-time30→15 on the Forgejo curl wrappers so a brief server blip fails fast instead of wedging a tick. Clean, focused, well-tested. Approve.lib/forgejo.sh: IntroducesFORGEJO_CONNECT_TIMEOUT=5/FORGEJO_MAX_TIME=15and threads them through_fj(both body/no-body branches),_forgejo_post_reviewers, and the image-upload path (which correctly keeps its--max-time 60per the description). The fix is sound — a bare--max-timewith no connect-timeout does stall the full max-time on an unreachable host, and bounding the connect phase is the right lever.bin/test-forgejo.sh: The new test shimscurlto echo args, runs the real_fj GET /version(no-body → else branch) before fixtures stub_fj, and asserts both flags are present plus that the connect timeout is< 30. This genuinely fails without the fix. Good targeted coverage.No security, correctness, or scope concerns. The 5s/15s values are a reasonable operator judgment call for small same-network JSON calls.
===BODY===
Independent review by the harness on
claude-opus-4-8(effort: high). The human reviewer is requested once Igor has reviewed; a human still merges.