-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
More details here: https://bugzilla.mozilla.org/show_bug.cgi?id=1807010#c2
rkv's safe mode protects the in-memory database contents with an RwLock (
), but that lock is released inrkv/src/backend/impl_safe/environment.rs
Lines 234 to 236 in c5a7594
pub(crate) fn dbs_mut(&self) -> Result<RwLockWriteGuard<EnvironmentDbs>, ErrorImpl> { self.dbs.write().map_err(|_| ErrorImpl::EnvPoisonError) } , before flushing the contents to disk. So, even if (2) weren't a factor, multiple calls to EnvironmentImpl.write_to_disk() from different task queues could still race with each other.rkv/src/backend/impl_safe/transaction.rs
Line 192 in c5a7594
drop(dbs);
I wonder we can mitigate this issue by adding a separate lock solely for this write_to_disk() and wait for the lock for each write.
Metadata
Metadata
Assignees
Labels
No labels