GRI-1919: read PDF pages into memory before removing the render directory #132
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!132
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-1919-pdf-render-dir-deleted-early"
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?
Summary
Fixes grimoire-of-digital-signage#131 — every PDF upload failed with
reading a converted page: No such file or directory (os error 2).convert_pdf_uploadremovedrender_dirviaremove_dir_allimmediately afterrender_pdf_pagesreturned, before the page file paths it returned were ever read. The later loop then tried totokio::fs::readeach page path from the now-deleted directory and failed every time.Fix: added
read_pdf_pages, which renders the PDF and reads every page into memory (Vec<Vec<u8>>) before returning, sorender_diris only removed after all page bytes are already in memory. The write loop now stores the in-memory bytes directly instead of re-reading from disk.Test plan
./scripts/local-gates.sh --rust-onlypasses (bans/licenses/sources ok, every gate passed).POST /api/v1/mediawith a multi-page PDF) is fixed by this change: pages are read before the render directory is removed, so the race is eliminated.