granian icon indicating copy to clipboard operation
granian copied to clipboard

Investigate if `Path::canonicalize` should be asyncified

Open mollymorphous opened this issue 5 months ago • 1 comments

Following discussion in #577, the static file server calls Path::canonicalize in the worker thread. It's not clear if this risks blocking the worker thread enough to matter. There's a tokio::fs::canonicalize which could replace it if it needs to get moved to the I/O worker pool.

mollymorphous avatar Jul 24 '25 18:07 mollymorphous

The risk is near-zero on local FS, maybe only under extreme I/O or memory pressure; however, in such cases, it would be the least of all worries.

With remote FS (NFS in particular), this could indeed cause noticeable blocking, especially if the remote side is unavailable for a while.

aldem avatar Jul 25 '25 20:07 aldem