diff --git a/lib/gitlab/exclusive_lease_helpers.rb b/lib/gitlab/exclusive_lease_helpers.rb index ab6838adc6d..e998548cff9 100644 --- a/lib/gitlab/exclusive_lease_helpers.rb +++ b/lib/gitlab/exclusive_lease_helpers.rb @@ -21,7 +21,7 @@ module Gitlab raise FailedToObtainLockError, 'Failed to obtain a lock' unless uuid - return yield + yield ensure Gitlab::ExclusiveLease.cancel(key, uuid) end