next.js
cd243042 - Turbopack: add more context to persistence file errors (#95318)

Commit
84 days ago
Turbopack: add more context to persistence file errors (#95318) ### What? Adds path- and operation-level context to the filesystem errors raised by the `turbo-persistence` commit/rollback flow and the `turbo-tasks-backend` database invalidation/versioning helpers. ### Why? A user reported a bare `Access is denied. (OS error 5)` on Windows 11 that surfaced out of the cache `commit` flow with no indication of which file or which filesystem operation failed: https://github.com/vercel/next.js/discussions/95130#discussioncomment-17479429 The underlying issue was fixed in #95495 but this adds more information for future issues. Raw `io::Error`s from `?` carry an OS error code but no path, so there was no way to tell whether the failure was on `CURRENT`, a `.del` file, a per-file `fsync`, the directory `fsync`, or a cleanup `remove_file` etc. ### How? - Adopted the `fs_err` crate for all fs operations in the persistence layer - Added additional context to some flows - Unified `CURRENT` file writing and adopted an 'atomic write' pattern. <!-- NEXT_JS_LLM_PR -->
Author
Parents
Loading