diff options
author | Paul Okstad <pokstad@gitlab.com> | 2019-11-19 19:39:44 +0300 |
---|---|---|
committer | Paul Okstad <pokstad@gitlab.com> | 2019-11-19 19:39:44 +0300 |
commit | ff5af0057f2dfcfe39e5a41a164eca50f72d6cd2 (patch) | |
tree | 97e1c4f563821a1c117f24849459c5e505e11c1c | |
parent | 3b68223057bed9d6e6111e7882daa3d0b679c316 (diff) | |
parent | 4af5aefc6b9ebe9143f9ccbf7234fbfb7b474514 (diff) |
Merge branch 'po-keepalive-fix' into 'master'
Fix client keep alive for all network types
See merge request gitlab-org/gitaly!1637
-rw-r--r-- | changelogs/unreleased/po-keepalive-fix.yml | 5 | ||||
-rw-r--r-- | client/dial.go | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/changelogs/unreleased/po-keepalive-fix.yml b/changelogs/unreleased/po-keepalive-fix.yml new file mode 100644 index 000000000..dec65ae6e --- /dev/null +++ b/changelogs/unreleased/po-keepalive-fix.yml @@ -0,0 +1,5 @@ +--- +title: Fix client keep alive for all network types +merge_request: 1637 +author: +type: fixed diff --git a/client/dial.go b/client/dial.go index 81dea7d5b..8ab04e788 100644 --- a/client/dial.go +++ b/client/dial.go @@ -71,13 +71,14 @@ func Dial(rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, erro return net.DialTimeout("unix", path, timeout) }), - grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: 20 * time.Second, - PermitWithoutStream: true, - }), ) } + connOpts = append(connOpts, grpc.WithKeepaliveParams(keepalive.ClientParameters{ + Time: 20 * time.Second, + PermitWithoutStream: true, + })) + conn, err := grpc.Dial(canonicalAddress, connOpts...) if err != nil { return nil, err |