Skip to content
Permalink
Browse files
fix: make keepalive params a bit conservative (#528)
  • Loading branch information
sushanb committed Nov 13, 2020
1 parent e7d636a commit f5f66c9ce019a6a24ddfe1efc0141835f5a02f34
@@ -124,10 +124,9 @@ public ManagedChannelBuilder apply(ManagedChannelBuilder input) {
return input.usePlaintext();
}
})
.setKeepAliveTime(Duration.ofSeconds(10)) // sends ping in this interval
.setKeepAliveTime(Duration.ofSeconds(30)) // sends ping in this interval
.setKeepAliveTimeout(
Duration.ofSeconds(10)) // wait this long before considering the connection dead
.setKeepAliveWithoutCalls(true) // sends ping without active streams
.build());

LOGGER.info("Connecting to the Bigtable emulator at " + hostname + ":" + port);
@@ -245,10 +245,9 @@ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProvi
return BigtableStubSettings.defaultGrpcTransportProviderBuilder()
.setPoolSize(getDefaultChannelPoolSize())
.setMaxInboundMessageSize(MAX_MESSAGE_SIZE)
.setKeepAliveTime(Duration.ofSeconds(10)) // sends ping in this interval
.setKeepAliveTime(Duration.ofSeconds(30)) // sends ping in this interval
.setKeepAliveTimeout(
Duration.ofSeconds(10)) // wait this long before considering the connection dead
.setKeepAliveWithoutCalls(true) // sends ping without active streams
// TODO(weiranf): Set this to true by default once DirectPath goes to public beta
.setAttemptDirectPath(isDirectPathEnabled());
}

0 comments on commit f5f66c9

Please sign in to comment.