diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-09 18:39:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-09 18:39:53 +0300 |
commit | ff0dfda44e6b0896c31ef7822227877c4c95e12c (patch) | |
tree | 049db614074bd3343fd1e370113873ffb6ee4fed /lib/gitlab | |
parent | dbff55cb6962eb6209b1c4ced1cd79fb53607ebd (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-ee
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/gitaly_client/server_service.rb | 13 | ||||
-rw-r--r-- | lib/gitlab/health_checks/gitaly_check.rb | 26 |
2 files changed, 4 insertions, 35 deletions
diff --git a/lib/gitlab/gitaly_client/server_service.rb b/lib/gitlab/gitaly_client/server_service.rb index 48fd0e66354..36bda67c26e 100644 --- a/lib/gitlab/gitaly_client/server_service.rb +++ b/lib/gitlab/gitaly_client/server_service.rb @@ -26,19 +26,6 @@ module Gitlab storage_specific(disk_statistics) end - def readiness_check - request = Gitaly::ReadinessCheckRequest.new(timeout: GitalyClient.medium_timeout) - response = GitalyClient.call(@storage, :server_service, :readiness_check, request, timeout: GitalyClient.default_timeout) - - return { success: true } if response.ok_response - - failed_checks = response.failure_response.failed_checks.map do |failed_check| - ["#{failed_check.name}: #{failed_check.error_message}"] - end - - { success: false, message: failed_checks.join("\n") } - end - private def storage_specific(response) diff --git a/lib/gitlab/health_checks/gitaly_check.rb b/lib/gitlab/health_checks/gitaly_check.rb index 2bd8ea711b5..f5f142c251f 100644 --- a/lib/gitlab/health_checks/gitaly_check.rb +++ b/lib/gitlab/health_checks/gitaly_check.rb @@ -27,35 +27,17 @@ module Gitlab end def check(storage_name) - storage_healthy = healthy(storage_name) - unless storage_healthy[:success] - return HealthChecks::Result.new( - name, - storage_healthy[:success], - storage_healthy[:message], - shard: storage_name - ) - end + serv = Gitlab::GitalyClient::HealthCheckService.new(storage_name) + result = serv.check - storage_ready = ready(storage_name) HealthChecks::Result.new( name, - storage_ready[:success], - storage_ready[:message], + result[:success], + result[:message], shard: storage_name ) end - def healthy(storage_name) - serv = Gitlab::GitalyClient::HealthCheckService.new(storage_name) - serv.check - end - - def ready(storage_name) - serv = Gitlab::GitalyClient::ServerService.new(storage_name) - serv.readiness_check - end - private def metric_prefix |