diff options
author | Paul Okstad <pokstad@gitlab.com> | 2019-10-16 13:48:44 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2019-10-16 13:48:44 +0300 |
commit | c60aeaa85b791da42f6410902e9e3504d2e8853c (patch) | |
tree | d2a3753d4bf93d7067fb27eb6366459f4c65438d | |
parent | a20beb0ed2fb3247d221bdf8e3bfcdc397416377 (diff) |
Lower gRPC server inactivity ping timeout
-rw-r--r-- | changelogs/unreleased/po-server-keep-alive.yml | 5 | ||||
-rw-r--r-- | client/dial.go | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/changelogs/unreleased/po-server-keep-alive.yml b/changelogs/unreleased/po-server-keep-alive.yml new file mode 100644 index 000000000..d763e0120 --- /dev/null +++ b/changelogs/unreleased/po-server-keep-alive.yml @@ -0,0 +1,5 @@ +--- +title: Lower gRPC server inactivity ping timeout +merge_request: 1294 +author: +type: added diff --git a/client/dial.go b/client/dial.go index 190cb7ca9..13518882e 100644 --- a/client/dial.go +++ b/client/dial.go @@ -6,6 +6,7 @@ import ( "time" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" "net/url" @@ -70,6 +71,10 @@ 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, + }), ) } |