Files
Tonis Tiigi 8c78c7128f cache: synchronize isDead check in getRecord
getRecord checked rec.isDead() holding only cm.mu, while finalize
updates equalMutable and the mutable's dead flag under the record
mutex, so a concurrent Get and Finalize of a lazily committed ref
raced. Take the record mutex for the check; lock order stays cm.mu
then record mutex, as in get().

Records restored from metadata also did not follow the rule that
records sharing data share a mutex: the immutable got a new mutex
instead of the equal mutable's, as mutableRef.commit does. Share it,
so finalize and lookups of the mutable synchronize after a restart.

Add tests for both cases; they report the races under -race without
the fix.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-25 20:08:26 -07:00
..
2026-08-26 02:06:18 -07:00
2026-09-30 15:12:29 +02:00
2025-01-13 16:42:48 -08:00
2025-05-02 12:19:17 -07:00