From 427877c95c0ab5e7687d8f49d2159c7df4fcfcdf Mon Sep 17 00:00:00 2001 From: James Fargher Date: Wed, 10 Jun 2020 12:13:06 +1200 Subject: Allow more frequent keep-alive checking on server --- client/dial.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client') diff --git a/client/dial.go b/client/dial.go index e1a6fd12b..4fce2ac5b 100644 --- a/client/dial.go +++ b/client/dial.go @@ -74,6 +74,8 @@ func DialContext(ctx context.Context, rawAddress string, connOpts []grpc.DialOpt ) } + // grpc.KeepaliveParams must be specified at least as large as what is allowed by the + // server-side grpc.KeepaliveEnforcementPolicy connOpts = append(connOpts, grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: 20 * time.Second, PermitWithoutStream: true, -- cgit v1.2.3