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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
51e4196c
Commit
51e4196c
authored
Mar 05, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable client-side GRPC keepalive for Gitaly
parent
da2ab608
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
changelogs/unreleased/gitaly_keepalive.yml
changelogs/unreleased/gitaly_keepalive.yml
+5
-0
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+11
-1
No files found.
changelogs/unreleased/gitaly_keepalive.yml
0 → 100644
View file @
51e4196c
---
title
:
Enable client-side GRPC keepalive for Gitaly
merge_request
:
26536
author
:
type
:
changed
lib/gitlab/gitaly_client.rb
View file @
51e4196c
...
@@ -42,7 +42,7 @@ module Gitlab
...
@@ -42,7 +42,7 @@ module Gitlab
klass
=
stub_class
(
name
)
klass
=
stub_class
(
name
)
addr
=
stub_address
(
storage
)
addr
=
stub_address
(
storage
)
creds
=
stub_creds
(
storage
)
creds
=
stub_creds
(
storage
)
klass
.
new
(
addr
,
creds
,
interceptors:
interceptors
)
klass
.
new
(
addr
,
creds
,
interceptors:
interceptors
,
channel_args:
channel_args
)
end
end
end
end
end
end
...
@@ -54,6 +54,16 @@ module Gitlab
...
@@ -54,6 +54,16 @@ module Gitlab
end
end
private_class_method
:interceptors
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
def
self
.
stub_cert_paths
cert_paths
=
Dir
[
"
#{
OpenSSL
::
X509
::
DEFAULT_CERT_DIR
}
/*"
]
cert_paths
=
Dir
[
"
#{
OpenSSL
::
X509
::
DEFAULT_CERT_DIR
}
/*"
]
cert_paths
<<
OpenSSL
::
X509
::
DEFAULT_CERT_FILE
if
File
.
exist?
OpenSSL
::
X509
::
DEFAULT_CERT_FILE
cert_paths
<<
OpenSSL
::
X509
::
DEFAULT_CERT_FILE
if
File
.
exist?
OpenSSL
::
X509
::
DEFAULT_CERT_FILE
...
...
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