Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
5305d526
Commit
5305d526
authored
Jul 09, 2019
by
John Cai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disabling can_use_disk? temporarily
parent
db1b15e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+12
-11
spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb
spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb
+2
-0
No files found.
lib/gitlab/gitaly_client.rb
View file @
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
)
...
...
spec/lib/gitlab/git/rugged_impl/use_rugged_spec.rb
View file @
5305d526
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment