Skip to content

Commit

Permalink
Comment fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgritter committed Mar 17, 2021
1 parent 1704a8d commit 044d252
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vault/expiration.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,10 @@ func (m *ExpirationManager) revokeCommon(ctx context.Context, leaseID string, fo

if !skipToken {
// Acquire lease for this lock
// If skipToken is true, then we're being called via RevokeByToken, so
// probably (always?) the lock is already held, and if we re-acquire it
// we get deadlock.
// If skipToken is true, then we're either being (1) called via RevokeByToken, so
// probably the lock is already held, and if we re-acquire we get deadlock, or
// (2) called by tidy, in which case the lock is not held.
// Is it worth separating those cases out, or is (2) OK to proceed unlocked?
leaseLock := m.lockForLeaseID(leaseID)
leaseLock.Lock()
defer leaseLock.Unlock()
Expand Down

0 comments on commit 044d252

Please sign in to comment.