mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 07:07:25 +08:00
keep alive for streaming connections
fix https://github.com/chrislusf/seaweedfs/issues/2096 related to https://github.com/chrislusf/seaweedfs/issues/1277
This commit is contained in:
@@ -50,7 +50,7 @@ func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {
|
|||||||
}),
|
}),
|
||||||
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
|
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
|
||||||
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
|
MinTime: 60 * time.Second, // min time a client should wait before sending a ping
|
||||||
PermitWithoutStream: false,
|
PermitWithoutStream: true,
|
||||||
}),
|
}),
|
||||||
grpc.MaxRecvMsgSize(Max_Message_Size),
|
grpc.MaxRecvMsgSize(Max_Message_Size),
|
||||||
grpc.MaxSendMsgSize(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{
|
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
||||||
Time: 30 * time.Second, // client ping server if no activity for this long
|
Time: 30 * time.Second, // client ping server if no activity for this long
|
||||||
Timeout: 20 * time.Second,
|
Timeout: 20 * time.Second,
|
||||||
PermitWithoutStream: false,
|
PermitWithoutStream: true,
|
||||||
}))
|
}))
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
if opt != nil {
|
if opt != nil {
|
||||||
|
Reference in New Issue
Block a user