aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-05-31 01:26:24 -0700
committerChris Lu <chris.lu@gmail.com>2021-05-31 01:26:24 -0700
commitc5de97ddbe6036556f23667cb2870947734051f1 (patch)
tree1cc6739e648a7933898c1e771dcf172842dab404
parent2b60e2abb1dcc0d74c23dcfb8350bff0b9e5ddd8 (diff)
downloadseaweedfs-c5de97ddbe6036556f23667cb2870947734051f1.tar.xz
seaweedfs-c5de97ddbe6036556f23667cb2870947734051f1.zip
keep alive for streaming connections
fix https://github.com/chrislusf/seaweedfs/issues/2096 related to https://github.com/chrislusf/seaweedfs/issues/1277
-rw-r--r--weed/pb/grpc_client_server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go
index 5490339b3..fac8adcb3 100644
--- a/weed/pb/grpc_client_server.go
+++ b/weed/pb/grpc_client_server.go
@@ -50,7 +50,7 @@ func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {
}),
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
- PermitWithoutStream: false,
+ PermitWithoutStream: true,
}),
grpc.MaxRecvMsgSize(Max_Message_Size),
grpc.MaxSendMsgSize(Max_Message_Size),
@@ -76,7 +76,7 @@ func GrpcDial(ctx context.Context, address string, opts ...grpc.DialOption) (*gr
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: 30 * time.Second, // client ping server if no activity for this long
Timeout: 20 * time.Second,
- PermitWithoutStream: false,
+ PermitWithoutStream: true,
}))
for _, opt := range opts {
if opt != nil {