Skip to content

Commit

Permalink
Fix refcount update error when update lock requires ack
Browse files Browse the repository at this point in the history
  • Loading branch information
snower committed May 18, 2024
1 parent 168a228 commit 27dd704
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,13 @@ func (self *LockDB) DoAckLock(lock *Lock, succed bool) {
lockData = lockManager.GetLockData()
}
lockProtocol, lockCommand := lock.protocol, lock.command
lock.refCount--
if lock.refCount == 0 {
lockManager.FreeLock(lock)
if lockManager.refCount == 0 {
self.RemoveLockManager(lockManager)
}
}
lockManager.glock.Unlock()

_ = lockProtocol.ProcessLockResultCommandLocked(lockCommand, protocol.RESULT_LOCKED_ERROR, uint16(lockManager.locked), lock.locked, lockData)
Expand Down

0 comments on commit 27dd704

Please sign in to comment.