Download latest with more than 64 items hangs the request and holds up adding feeds and Refresh #154

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

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

The worker's command queue holds 64 (mpsc::channel::<Cmd>(64), src/main.rs:560), and the web handlers that hand it work wait inside the request for a slot. "Download latest items" lets you ask for up to 100 (web/src/dialogs.ts:517), and download_latest (src/web.rs:2022-2030) sends one Download command per file.

Asking for more than 64 while the queue is empty: the first 64 go in, the 65th waits for the worker to finish a whole download, then the next, and so on, an hour for 100 episodes. Cloudflare gives up on the request after about 100 s and the page shows an error, though most of them were queued. Meanwhile every other request that queues work waits for a slot too: adding a feed (its first scan), Refresh, Download, and ipx commands through the socket.

Fix: a queue big enough for any one burst; the commands are a few bytes each.

Found in a code audit on 2026-10-09. The worker's command queue holds 64 (`mpsc::channel::<Cmd>(64)`, `src/main.rs:560`), and the web handlers that hand it work wait inside the request for a slot. "Download latest items" lets you ask for up to 100 (`web/src/dialogs.ts:517`), and `download_latest` (`src/web.rs:2022-2030`) sends one `Download` command per file. Asking for more than 64 while the queue is empty: the first 64 go in, the 65th waits for the worker to finish a whole download, then the next, and so on, an hour for 100 episodes. Cloudflare gives up on the request after about 100 s and the page shows an error, though most of them were queued. Meanwhile every other request that queues work waits for a slot too: adding a feed (its first scan), Refresh, Download, and `ipx` commands through the socket. Fix: a queue big enough for any one burst; the commands are a few bytes each.
rays added the bug label 2026-10-08 18:36:21 -07:00
Author
Owner

Fixed in 1529129: the worker's queue holds 1024 commands, room for any one request's (Download latest sends at most 100). Deployed as 0.10.3-dev on 2026-10-09.

Fixed in 1529129: the worker's queue holds 1024 commands, room for any one request's (Download latest sends at most 100). Deployed as 0.10.3-dev on 2026-10-09.
rays closed this issue 2026-10-08 18:58:42 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#154