summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-07-30 16:00:31 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-07-30 16:00:31 +0000
commit6f240d7b0c73560ebd7cec141a042c3840c475cf (patch)
tree060518f61405b52112921fc5627724e04007be60
parentff060ad4056494d32c00a06b134b1f4e20751e19 (diff)
parent3091897bf94789fb8d7d79439c44c3ec005e627e (diff)
downloadgitlab-ce-6f240d7b0c73560ebd7cec141a042c3840c475cf.tar.gz
Merge branch 'rails5-gpg-permit-concurrent' into 'master'
Permit concurrent loads in gpg keychain mutex See merge request gitlab-org/gitlab-ce!20894
-rw-r--r--changelogs/unreleased/rails5-gpg-permit-concurrent.yml5
-rw-r--r--lib/gitlab/gpg.rb12
2 files changed, 15 insertions, 2 deletions
diff --git a/changelogs/unreleased/rails5-gpg-permit-concurrent.yml b/changelogs/unreleased/rails5-gpg-permit-concurrent.yml
new file mode 100644
index 00000000000..cf1b0023f86
--- /dev/null
+++ b/changelogs/unreleased/rails5-gpg-permit-concurrent.yml
@@ -0,0 +1,5 @@
+---
+title: Permit concurrent loads in gpg keychain mutex
+merge_request: 20894
+author: Jasper Maes
+type: fixed
diff --git a/lib/gitlab/gpg.rb b/lib/gitlab/gpg.rb
index a4263369269..8a91e034377 100644
--- a/lib/gitlab/gpg.rb
+++ b/lib/gitlab/gpg.rb
@@ -71,8 +71,16 @@ module Gitlab
if MUTEX.locked? && MUTEX.owned?
optimistic_using_tmp_keychain(&block)
else
- MUTEX.synchronize do
- optimistic_using_tmp_keychain(&block)
+ if Gitlab.rails5?
+ ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
+ MUTEX.synchronize do
+ optimistic_using_tmp_keychain(&block)
+ end
+ end
+ else
+ MUTEX.synchronize do
+ optimistic_using_tmp_keychain(&block)
+ end
end
end
end