From 8f68e7c4372e331a3b3088666037012615db8c5c Mon Sep 17 00:00:00 2001 From: Maciej Kwiek Date: Mon, 24 Jul 2017 11:29:17 +0200 Subject: [PATCH] Fix deadlock on UnlockRelease Locking release map is not needed in UnlockRelease as the goroutine releasing the lock must first acquire it. More importantly it resulted in deadlocks, which got investigated by Justin Scott (justin.a.scott@intel.com). --- pkg/storage/storage.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/storage/storage.go b/pkg/storage/storage.go index b5aa16ccb..fcbfae301 100644 --- a/pkg/storage/storage.go +++ b/pkg/storage/storage.go @@ -193,8 +193,6 @@ func (s *Storage) LockRelease(name string) error { // If release doesn't exist or wasn't previously locked - the unlock will pass func (s *Storage) UnlockRelease(name string) { s.Log("unlocking release %s", name) - s.releaseLocksLock.Lock() - defer s.releaseLocksLock.Unlock() var lock *sync.Mutex lock, exists := s.releaseLocks[name]