Artwork that can never be shown is downloaded again every hour #448

Open
opened 2026-11-13 06:26:02 -08:00 by rays · 0 comments
Owner

/api/art remembers a failed image for an hour only (RETRY in crates/ipx/src/art.rs), whatever the failure. Images that will never pass are fetched again on the next view after that:

  • over the 20 MB limit: 146 fetches in 2026-11-09..13 of five images (b2c-contenthub.com GIFs, a macstories PNG, a Verge GIF), about 37 each. Each reads up to 20 MB before refusing, since the body is counted chunk by chunk and Content-Length is not looked at first: roughly 3 GB downloaded for nothing.
  • a 400 from b2c-contenthub.com (macos-touch-photos-app.gif): 34 times.
  • JPEG XL pictures from shkspr.mobi, served as application/octet-stream: image_kind sniffs JPEG, PNG, GIF and WebP only, so they fail with not an image, and the reader shows nothing where Safari could have shown them.

425 GET /api/art -> 502 in the same days. Found by the prod check.

$Q metric 'sum by (error) (count_over_time({container="iPX"} |= "could not fetch artwork" | json | __error__="" [$range]))' 5d

Refusing on Content-Length before reading, and remembering a too-large or 4xx answer for longer than an hour, would stop most of it.

`/api/art` remembers a failed image for an hour only (`RETRY` in crates/ipx/src/art.rs), whatever the failure. Images that will never pass are fetched again on the next view after that: - over the 20 MB limit: 146 fetches in 2026-11-09..13 of five images (b2c-contenthub.com GIFs, a macstories PNG, a Verge GIF), about 37 each. Each reads up to 20 MB before refusing, since the body is counted chunk by chunk and `Content-Length` is not looked at first: roughly 3 GB downloaded for nothing. - a 400 from b2c-contenthub.com (macos-touch-photos-app.gif): 34 times. - JPEG XL pictures from shkspr.mobi, served as `application/octet-stream`: `image_kind` sniffs JPEG, PNG, GIF and WebP only, so they fail with `not an image`, and the reader shows nothing where Safari could have shown them. 425 `GET /api/art -> 502` in the same days. Found by the prod check. ``` $Q metric 'sum by (error) (count_over_time({container="iPX"} |= "could not fetch artwork" | json | __error__="" [$range]))' 5d ``` Refusing on `Content-Length` before reading, and remembering a too-large or 4xx answer for longer than an hour, would stop most of it.
rays added the bug label 2026-11-13 06:26:02 -08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#448