From fbfc6078340883187a27c8f34814b49ce782f58c Mon Sep 17 00:00:00 2001 From: Sam Whittle Date: Fri, 1 Apr 2022 12:53:26 +0000 Subject: [PATCH 1/4] [BEAM-13015] Disable retries for grpc channels which otherwise default to true. Since the channel is to the local runner process, retries are not expected to help. This simplifies the grpc stream stack to not involve a RetryStream object. --- .../org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java index 4b172f169fb2..64375c8ab97b 100644 --- a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java +++ b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java @@ -89,6 +89,8 @@ public ManagedChannel forDescriptor(ApiServiceDescriptor apiServiceDescriptor) { // Set the message size to max value here. The actual size is governed by the // buffer size in the layers above. .maxInboundMessageSize(Integer.MAX_VALUE) + // Disable automatic retries as it introduces overhead and the harness is local. + .disableRetry() .intercept(interceptors); if (directExecutor) { channelBuilder = channelBuilder.directExecutor(); From 014cb738599e3bac29ec30446e6907aa26114b7e Mon Sep 17 00:00:00 2001 From: scwhittle Date: Mon, 4 Apr 2022 12:43:39 +0200 Subject: [PATCH 2/4] fixup comment --- .../org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java index 64375c8ab97b..902bab29f5d3 100644 --- a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java +++ b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java @@ -89,7 +89,9 @@ public ManagedChannel forDescriptor(ApiServiceDescriptor apiServiceDescriptor) { // Set the message size to max value here. The actual size is governed by the // buffer size in the layers above. .maxInboundMessageSize(Integer.MAX_VALUE) - // Disable automatic retries as it introduces overhead and the harness is local. + // Disable automatic retries as it introduces complexity and we send long-lived + // rpcs which will exceed the per-rpc retry request buffer and not be retried + // anyway. See https://github.com/grpc/proposal/blob/master/A6-client-retries.md#when-retries-are-valid .disableRetry() .intercept(interceptors); if (directExecutor) { From 79639ef10073630d976fb80a28b2d2628112eaa7 Mon Sep 17 00:00:00 2001 From: Lukasz Cwik Date: Mon, 4 Apr 2022 14:28:46 -0700 Subject: [PATCH 3/4] Update sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java --- .../org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java index 902bab29f5d3..5ca2278aafef 100644 --- a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java +++ b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java @@ -91,7 +91,8 @@ public ManagedChannel forDescriptor(ApiServiceDescriptor apiServiceDescriptor) { .maxInboundMessageSize(Integer.MAX_VALUE) // Disable automatic retries as it introduces complexity and we send long-lived // rpcs which will exceed the per-rpc retry request buffer and not be retried - // anyway. See https://github.com/grpc/proposal/blob/master/A6-client-retries.md#when-retries-are-valid + // anyway. See + // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#when-retries-are-valid .disableRetry() .intercept(interceptors); if (directExecutor) { From 14af3cb5064ea8b1969585a84f57817c9c1693cd Mon Sep 17 00:00:00 2001 From: Lukasz Cwik Date: Mon, 4 Apr 2022 14:31:23 -0700 Subject: [PATCH 4/4] Update sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java --- .../org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java index 5ca2278aafef..70e805abeabc 100644 --- a/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java +++ b/sdks/java/fn-execution/src/main/java/org/apache/beam/sdk/fn/channel/ManagedChannelFactory.java @@ -89,8 +89,8 @@ public ManagedChannel forDescriptor(ApiServiceDescriptor apiServiceDescriptor) { // Set the message size to max value here. The actual size is governed by the // buffer size in the layers above. .maxInboundMessageSize(Integer.MAX_VALUE) - // Disable automatic retries as it introduces complexity and we send long-lived - // rpcs which will exceed the per-rpc retry request buffer and not be retried + // Disable automatic retries as it introduces complexity and we send long-lived + // rpcs which will exceed the per-rpc retry request buffer and not be retried // anyway. See // https://github.com/grpc/proposal/blob/master/A6-client-retries.md#when-retries-are-valid .disableRetry()