Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: exit after HIVE_FORGE_DEADLINE instead of hanging on a stalled forge

forgejo-api 0.11.1's sync client builds its own reqwest client with no
timeout and takes no caller-supplied client (sync.rs: new and
with_user_agent are the only constructors), so a forge that accepts a
connection and then stalls blocked every typed verb forever.

A watchdog thread now starts before the client is built. After
HIVE_FORGE_DEADLINE seconds (default 900, five minutes above
DOWNLOAD_TIMEOUT) it prints a hive-forge: FAILED: line and exits 75.
It bounds the whole command, not each request, and a write may already
have landed when it fires; the help text and docs/tools/forge.md say so.
This commit is contained in:
atlas 2026-10-16 21:59:13 +02:00 • committed by mara
commit ccc6993703
7 changed files with 192 additions and 2 deletions

View file

@ -31,7 +31,7 @@ const JSON_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(15);
/// `reqwest::blocking` has no separate read/idle timeout, so this bounds
/// the whole download rather than cutting it off partway through like
/// [`JSON_TIMEOUT`] would.
const DOWNLOAD_TIMEOUT: std::time::Duration = std::time::Duration::from_mins(10);
pub(crate) const DOWNLOAD_TIMEOUT: std::time::Duration = std::time::Duration::from_mins(10);
/// Forgejo client pair: the typed `/api/v1` client plus a raw
/// `reqwest` client for web-router-only routes.