A download that stalls partway stops every scan and download, and the daemon still reports healthy #152

Closed
opened 2026-10-08 18:36:20 -07:00 by rays · 1 comment
Owner

Found in a code audit on 2026-10-09.

The client downloads use (ctx.client, src/main.rs:291-296) has a connect timeout and nothing else, on purpose so a long download is not cut off (#108). But nothing bounds a read either: a server that starts sending a file and then stops, without closing the connection (a half-open connection, a stalled CDN), leaves stream.next().await in download::download waiting for good.

Downloads run on the single worker, one job at a time, so every later scan and download waits behind it. The healthcheck answers status itself and stays (healthy) throughout (CLAUDE.md says as much), so nothing says the daemon has stopped working; only the absence of scan complete lines would.

Fix: a read timeout on that client (ClientBuilder::read_timeout), which fires only when no bytes arrive for that long and so leaves long downloads alone.

Found in a code audit on 2026-10-09. The client downloads use (`ctx.client`, `src/main.rs:291-296`) has a connect timeout and nothing else, on purpose so a long download is not cut off (#108). But nothing bounds a read either: a server that starts sending a file and then stops, without closing the connection (a half-open connection, a stalled CDN), leaves `stream.next().await` in `download::download` waiting for good. Downloads run on the single worker, one job at a time, so every later scan and download waits behind it. The healthcheck answers `status` itself and stays `(healthy)` throughout (CLAUDE.md says as much), so nothing says the daemon has stopped working; only the absence of `scan complete` lines would. Fix: a read timeout on that client (`ClientBuilder::read_timeout`), which fires only when no bytes arrive for that long and so leaves long downloads alone.
rays added the bug label 2026-10-08 18:36:20 -07:00
Author
Owner

Fixed in d5edead: the download client has a 2-minute read timeout, which fires only when no bytes arrive, so a long download is untouched and a stalled one fails instead of holding the worker. Deployed as 0.10.3-dev on 2026-10-09.

Fixed in d5edead: the download client has a 2-minute read timeout, which fires only when no bytes arrive, so a long download is untouched and a stalled one fails instead of holding the worker. Deployed as 0.10.3-dev on 2026-10-09.
rays closed this issue 2026-10-08 18:58:41 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#152