next.js
f263c562 - Turbopack: Various cleanup for turbo-tasks-fs, mostly retry logic and string formatting (#88668)

Commit
61 days ago
Turbopack: Various cleanup for turbo-tasks-fs, mostly retry logic and string formatting (#88668) - https://github.com/vercel/next.js/pull/87661 removed the `tokio::task::spawn_blocking` call from `retry_blocking`, so we can simplify things a lot by removing the `Send + 'static` bounds, and eliminate a bunch of cloning `Path`s into `PathBuf`s. - `retry_blocking` no longer takes a path argument. After removing the path cloning requirements, it's now easier for callers to capture paths via a closure, and it's more flexible for IO operations that need to pass in more than a single path. - Adds `retry_blocking_custom`, which I use in #88669 that allows customizing what error kinds we retry on. - Adds documentation to `retry_blocking` explaining why we need this. It's often unclear to new people on the team why we have to retry filesystem operations (Windows, basically). This was unclear to me when I was new to this code, and other people have asked similar questions. - We shouldn't use `Path::display` for error messages or tracing spans. It's easier to use `Debug`, and `Debug` ensures that if the error is related to unicode, that information isn't lost in the error message. - More consistently apply tracing spans using `.instrument`. - Use the modern inline syntax for some format strings. - `let foo = RcStr::from(bar)` is preferred over `let foo: RcStr = bar.into()`
Author
bgw bgw
Parents
Loading