Commit 5c87eaf8 authored by James Lopez's avatar James Lopez

Merge branch 'gitaly_keepalive' into 'master'

Enable client-side GRPC keepalive for Gitaly

See merge request gitlab-org/gitlab!26536
parents 4f28668f 51e4196c
---
title: Enable client-side GRPC keepalive for Gitaly
merge_request: 26536
author:
type: changed
......@@ -42,7 +42,7 @@ module Gitlab
klass = stub_class(name)
addr = stub_address(storage)
creds = stub_creds(storage)
klass.new(addr, creds, interceptors: interceptors)
klass.new(addr, creds, interceptors: interceptors, channel_args: channel_args)
end
end
end
......@@ -54,6 +54,16 @@ module Gitlab
end
private_class_method :interceptors
def self.channel_args
# These values match the go Gitaly client
# https://gitlab.com/gitlab-org/gitaly/-/blob/bf9f52bc/client/dial.go#L78
{
'grpc.keepalive_time_ms': 20000,
'grpc.keepalive_permit_without_calls': 1
}
end
private_class_method :channel_args
def self.stub_cert_paths
cert_paths = Dir["#{OpenSSL::X509::DEFAULT_CERT_DIR}/*"]
cert_paths << OpenSSL::X509::DEFAULT_CERT_FILE if File.exist? OpenSSL::X509::DEFAULT_CERT_FILE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment