mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-09 19:07:12 +02:00
fscache's Remove drops the in-memory entry, releases the lock, and only then unlinks - blocking until every outstanding reader closes. A Get landing in that window re-creates the file at the same path under a fresh entry, and the deferred unlink deletes those new bytes. The entry survives pointing at nothing, and since a present entry is treated as a hit, every later Get for that key returns ENOENT for the rest of the process's life. Only a restart, which rebuilds the map from disk, cleared it. Get now drops such an entry and retries once, so a vanished data file costs one re-fetch instead of poisoning the key permanently. This also covers a file disappearing for reasons unrelated to that race, such as external deletion or a restored backup. Specs cover an in-process entry, one adopted at startup, and the deferred-removal race itself. |
||
|---|---|---|
| .. | ||
| benchmark_test.go | ||
| cache_suite_test.go | ||
| cached_http_client.go | ||
| cached_http_client_test.go | ||
| file_caches.go | ||
| file_caches_test.go | ||
| file_haunter.go | ||
| file_haunter_test.go | ||
| simple_cache.go | ||
| simple_cache_test.go | ||
| spread_fs.go | ||
| spread_fs_test.go | ||