Commit cd511759 authored by Stan Hu's avatar Stan Hu

Merge branch 'jc-disable-can-use-disk-temp' into 'master'

Disabling can_use_disk? temporarily

See merge request gitlab-org/gitlab-ce!30526
parents b2ecc809 5305d526
...@@ -388,20 +388,21 @@ module Gitlab ...@@ -388,20 +388,21 @@ module Gitlab
end end
def self.can_use_disk?(storage) def self.can_use_disk?(storage)
cached_value = MUTEX.synchronize do false
@can_use_disk ||= {} # cached_value = MUTEX.synchronize do
@can_use_disk[storage] # @can_use_disk ||= {}
end # @can_use_disk[storage]
# end
return cached_value unless cached_value.nil? # return cached_value unless cached_value.nil?
gitaly_filesystem_id = filesystem_id(storage) # gitaly_filesystem_id = filesystem_id(storage)
direct_filesystem_id = filesystem_id_from_disk(storage) # direct_filesystem_id = filesystem_id_from_disk(storage)
MUTEX.synchronize do # MUTEX.synchronize do
@can_use_disk[storage] = gitaly_filesystem_id.present? && # @can_use_disk[storage] = gitaly_filesystem_id.present? &&
gitaly_filesystem_id == direct_filesystem_id # gitaly_filesystem_id == direct_filesystem_id
end # end
end end
def self.filesystem_id(storage) def self.filesystem_id(storage)
......
...@@ -30,6 +30,7 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do ...@@ -30,6 +30,7 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do
end end
it 'returns true when gitaly matches disk' do it 'returns true when gitaly matches disk' do
pending('temporary disabled because of https://gitlab.com/gitlab-org/gitlab-ce/issues/64338')
expect(subject.use_rugged?(repository, feature_flag_name)).to be true expect(subject.use_rugged?(repository, feature_flag_name)).to be true
end end
...@@ -48,6 +49,7 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do ...@@ -48,6 +49,7 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do
end end
it "doesn't lead to a second rpc call because gitaly client should use the cached value" do it "doesn't lead to a second rpc call because gitaly client should use the cached value" do
pending('temporary disabled because of https://gitlab.com/gitlab-org/gitlab-ce/issues/64338')
expect(subject.use_rugged?(repository, feature_flag_name)).to be true expect(subject.use_rugged?(repository, feature_flag_name)).to be true
expect(Gitlab::GitalyClient).not_to receive(:filesystem_id) expect(Gitlab::GitalyClient).not_to receive(:filesystem_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment