grpc: reduce client idle pings to avoid ENHANCE_YOUR_CALM (#7885)
* grpc: reduce client idle pings to avoid ENHANCE_YOUR_CALM (too_many_pings) * test: use context.WithTimeout and pb constants for keepalive * test(kafka): use separate dial and client contexts in NewDirectBrokerClient * test(kafka): fix client context usage in NewDirectBrokerClient
This commit is contained in:
@@ -94,9 +94,11 @@ func GrpcDial(ctx context.Context, address string, waitForReady bool, opts ...gr
|
||||
grpc.WaitForReady(waitForReady),
|
||||
),
|
||||
grpc.WithKeepaliveParams(keepalive.ClientParameters{
|
||||
Time: GrpcKeepAliveTime, // client ping server if no activity for this long
|
||||
Timeout: GrpcKeepAliveTimeout, // ping timeout
|
||||
PermitWithoutStream: true,
|
||||
Time: GrpcKeepAliveTime, // client ping server if no activity for this long
|
||||
Timeout: GrpcKeepAliveTimeout, // ping timeout
|
||||
// Disable pings when there are no active streams to avoid triggering
|
||||
// server enforcement for too-frequent pings from idle clients.
|
||||
PermitWithoutStream: false,
|
||||
}))
|
||||
for _, opt := range opts {
|
||||
if opt != nil {
|
||||
|
||||
Reference in New Issue
Block a user