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
9be17322
Commit
9be17322
authored
Jul 27, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comment explaining use of shell commands and file operations in the same methods
parent
6ac0a142
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
lib/gitlab/health_checks/fs_shards_check.rb
lib/gitlab/health_checks/fs_shards_check.rb
+7
-0
No files found.
lib/gitlab/health_checks/fs_shards_check.rb
View file @
9be17322
...
@@ -77,6 +77,13 @@ module Gitlab
...
@@ -77,6 +77,13 @@ module Gitlab
storages_paths
&
.
dig
(
storage_name
,
'path'
)
storages_paths
&
.
dig
(
storage_name
,
'path'
)
end
end
# All below test methods use shell commands to perform actions on storage volumes.
# In case a storage volume have connectivity problems causing pure Ruby IO operation to wait indefinitely,
# we can rely on shell commands to be terminated once `timeout` kills them.
#
# However we also fallback to pure Ruby file operations in case a specific shell command is missing
# so we are still able to perform healthchecks and gather metrics from such system.
def
delete_test_file
(
tmp_path
)
def
delete_test_file
(
tmp_path
)
_
,
status
=
exec_with_timeout
(
%W{ rm -f
#{
tmp_path
}
}
)
_
,
status
=
exec_with_timeout
(
%W{ rm -f
#{
tmp_path
}
}
)
status
.
zero?
status
.
zero?
...
...
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