Skip to main content

Module spool

Module spool 

Source
Expand description

Where write buffers and read caches are spooled.

Both the write path and the read path back their temp files with real disk, never $TMPDIR: on most current Linux distros /tmp is a tmpfs, so spooling a multi-gigabyte upload there fills RAM and gets the process stopped by the OOM killer. The spool lives under the user’s cache directory instead.

The files stay unlinked (tempfile::tempfile_in), so a crash reclaims their space with no cleanup pass and no leftovers.

Enums§

CacheConvention
Cache-directory convention to follow when no explicit spool dir is given.

Functions§

prepare_spool_dir
Create the spool directory if needed and prove it’s writable.
resolve_spool_dir
Resolve the spool directory from an optional override and the environment.
spool_dir_from_env
Resolve the spool directory from the live environment.