From f5f66c9ce019a6a24ddfe1efc0141835f5a02f34 Mon Sep 17 00:00:00 2001 From: Sushan Bhattarai Date: Fri, 13 Nov 2020 12:20:11 -0700 Subject: [PATCH] fix: make keepalive params a bit conservative (#528) --- .../google/cloud/bigtable/data/v2/BigtableDataSettings.java | 3 +-- .../bigtable/data/v2/stub/EnhancedBigtableStubSettings.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java index 105fbaae45..f4d63b5ec0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/BigtableDataSettings.java @@ -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); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java index 0ce05d3a52..788aa1d3b0 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/EnhancedBigtableStubSettings.java @@ -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()); }