Skip to content

Commit

Permalink
fix: make keepalive params a bit conservative (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
sushanb committed Nov 13, 2020
1 parent e7d636a commit f5f66c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -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);
Expand Down
Expand Up @@ -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());
}
Expand Down

0 comments on commit f5f66c9

Please sign in to comment.