Skip to main content

atomic_replace

Function atomic_replace 

Source
pub fn atomic_replace(tmp: &Path, final_path: &Path) -> Result<()>
Expand description

Rename tmp over final_path.

On Windows a rename can fail with a sharing violation while another process still maps the old file (the background symbol indexer or an MCP query mid-flight). We retry with backoff, then fall back to copying the bytes over the final path so the index still lands. The fallback is not atomic, so it logs a warning.