Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

avoid deleting the entry too early

chrislu10ac25f85765
diff --git a/weed/util/lock_table.go b/weed/util/lock_table.go
index fd6e1987ab..8ec93f7e77 100644
--- a/weed/util/lock_table.go
+++ b/weed/util/lock_table.go
@@ -135,7 +135,7 @@ func (lt *LockTable[T]) ReleaseLock(key T, lock *ActiveLock) {
}
// If there are no waiters, release the lock
- if len(entry.waiters) == 0 {
+ if len(entry.waiters) == 0 && entry.activeExclusiveLockOwnerCount <= 0 && entry.activeSharedLockOwnerCount <= 0 {
delete(lt.locks, key)
}