From 10ac25f857655afe9a2397336d9abe7eb9338c66 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 23 Sep 2023 12:43:00 -0700 Subject: [PATCH] avoid deleting the entry too early --- weed/util/lock_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/util/lock_table.go b/weed/util/lock_table.go index fd6e1987a..8ec93f7e7 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) }