Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-16 18:09:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-16 18:09:50 +0300
commitb4e854a900ba9bcbfc3476f88317c59ea048daaf (patch)
tree562b380f7d3587c522d57487465b8df9d0c34746 /lib/gitlab/health_checks
parent8215fc964a189ae5c876a10f2e7d61933a725e24 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/health_checks')
-rw-r--r--lib/gitlab/health_checks/base_abstract_check.rb4
-rw-r--r--lib/gitlab/health_checks/master_check.rb13
-rw-r--r--lib/gitlab/health_checks/probes/collection.rb1
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/health_checks/base_abstract_check.rb b/lib/gitlab/health_checks/base_abstract_check.rb
index 7e1c5331b07..2eef359cc6e 100644
--- a/lib/gitlab/health_checks/base_abstract_check.rb
+++ b/lib/gitlab/health_checks/base_abstract_check.rb
@@ -11,6 +11,10 @@ module Gitlab
name.sub(/_check$/, '').capitalize
end
+ def available?
+ true
+ end
+
def readiness
raise NotImplementedError
end
diff --git a/lib/gitlab/health_checks/master_check.rb b/lib/gitlab/health_checks/master_check.rb
index 057bce84ddd..b2c3695e6d9 100644
--- a/lib/gitlab/health_checks/master_check.rb
+++ b/lib/gitlab/health_checks/master_check.rb
@@ -8,7 +8,16 @@ module Gitlab
extend SimpleAbstractCheck
class << self
+ extend ::Gitlab::Utils::Override
+
+ override :available?
+ def available?
+ Gitlab::Runtime.puma_in_clustered_mode?
+ end
+
def register_master
+ return unless available?
+
# when we fork, we pass the read pipe to child
# child can then react on whether the other end
# of pipe is still available
@@ -16,11 +25,15 @@ module Gitlab
end
def finish_master
+ return unless available?
+
close_read
close_write
end
def register_worker
+ return unless available?
+
# fork needs to close the pipe
close_write
end
diff --git a/lib/gitlab/health_checks/probes/collection.rb b/lib/gitlab/health_checks/probes/collection.rb
index 08b6d82291e..b34e4273d85 100644
--- a/lib/gitlab/health_checks/probes/collection.rb
+++ b/lib/gitlab/health_checks/probes/collection.rb
@@ -48,6 +48,7 @@ module Gitlab
def probe_readiness
checks
+ .select(&:available?)
.flat_map(&:readiness)
.compact
.group_by(&:name)