bread-screenshots: 5 s grim timeout truncates 4K captures under load and leaves a partial PNG #63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What
bread-screenshotsgivesgrima hard 5 second limit (GRIM_TIMEOUTinbread-screenshots/src/lib.rs). On a 3840x2160 output (headless Sway at scale 2) under CPU load, encoding the PNG takes longer than that.grimis killed mid-write, the app reportsgrim failed for geometry 0,0 1920x1080:with an empty reason, and a truncated PNG is left at the output path.Impact
stage-results,stage-calc,surtitle,surtitle-criticalin testing). Light views still pass, so the failure looks view-specific when it is really timing.identify, for example), treats it as a good capture. In one bread-capture run the truncated files sat next to the good ones with nothing marking them as broken.How it was found
Capturing breadbar main's spotlight views at 4K for the BOS trailer while another session was compiling Rust (load average around 7). The four views failed every time. With the timeout raised to 30 s in a private build, all four captured cleanly on the first try.
Confidence
High for the cause: the same views pass once the timeout is raised. Medium on the exact threshold, since it depends on machine load and output size.
Suggested fix
Implementation is available in PR #64 at
f9ea59975bcca94d94ea72bcfa27b67bce2fcaa6. Local checks passed: cargo test --offline -p bread-utils -p bread-screenshots and Clippy. Exact-head CI is pending and waiting to run; if it fails, move this item back to TODO.