Unanchored fastembed cache in OS temp dir caused silent worker crashes on Windows
A developer's background research worker crashed when a required ONNX model file vanished from the Windows temp directory, where the fastembed library had been silently caching models by default. Windows periodically purges the temp folder non-atomically, meaning only some files in a snapshot directory were deleted, causing a metadata mismatch and a missing model_optimized.onnx file. The bug had gone unnoticed in development because manual retries would trigger a re-download, masking the underlying instability. The root cause was that no explicit cache_dir argument was passed to fastembed's TextEmbedding, leaving it to fall back to the OS temp path. The fix involved declaring a stable, project-root-anchored cache path in the shared config and explicitly passing it to fastembed, mirroring how other persistent data paths like Qdrant were already managed.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in