diff options
| author | chrislu <chris.lu@gmail.com> | 2023-09-23 12:43:00 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2023-09-23 12:43:00 -0700 |
| commit | 10ac25f857655afe9a2397336d9abe7eb9338c66 (patch) | |
| tree | f7dc3fc62c192ff1b9a9c61610043ade2dcde18f | |
| parent | c43238b30a36ec2a2ac8d2060af5907be6b876c1 (diff) | |
| download | seaweedfs-10ac25f857655afe9a2397336d9abe7eb9338c66.tar.xz seaweedfs-10ac25f857655afe9a2397336d9abe7eb9338c66.zip | |
avoid deleting the entry too early
| -rw-r--r-- | weed/util/lock_table.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) } |
