Skip to content

Commit e6da855

Browse files
Copilotanidotnet
andcommitted
Improve comment clarity for defensive registry cleanup
Co-authored-by: anidotnet <696662+anidotnet@users.noreply.github.com>
1 parent e0b1f16 commit e6da855

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

nitrite-fjall-adapter/src/store.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,9 @@ impl FjallStoreInner {
462462
Ok(partition) => {
463463
match ks.delete_partition(partition.clone()) {
464464
Ok(_) => {
465-
// Ensure the map is removed from registry after successful deletion
466-
// This is defensive in case the map was re-opened between close_map and here
465+
// Defensive cleanup: Ensure the map is removed from registry after successful deletion.
466+
// This handles the unlikely race condition where the map might be re-opened
467+
// by another thread after close_map() but before delete_partition() completes.
467468
self.map_registry.remove(name);
468469
Ok(())
469470
}

0 commit comments

Comments
 (0)