Add a fast_timeout for the ServerService.ServerInfo endpoint

This commit is contained in:
Andrew Newdigate 2018-07-11 11:52:48 +01:00
parent 67708aa578
commit 7ee5b1f6fb
3 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
title: Use appropriate timeout on Gitaly server info checks, avoid error on timeout
merge_request: 20552
author:
type: fixed

View file

@ -50,7 +50,7 @@ module Gitaly
@info ||=
begin
Gitlab::GitalyClient::ServerService.new(@storage).info
rescue GRPC::Unavailable, GRPC::GRPC::DeadlineExceeded
rescue GRPC::Unavailable, GRPC::DeadlineExceeded
# This will show the server as being out of date
Gitaly::ServerInfoResponse.new(git_version: '', server_version: '', storage_statuses: [])
end

View file

@ -9,7 +9,7 @@ module Gitlab
end
def info
GitalyClient.call(@storage, :server_service, :server_info, Gitaly::ServerInfoRequest.new)
GitalyClient.call(@storage, :server_service, :server_info, Gitaly::ServerInfoRequest.new, timeout: GitalyClient.fast_timeout)
end
end
end