From ecc1802174b93ee18522d3e1ec31a2a4883b19c2 Mon Sep 17 00:00:00 2001 From: Riya Mehta Date: Mon, 19 May 2025 15:12:31 -0700 Subject: [PATCH 1/2] Skip S2A on platforms where netty-tcnative is not available --- .../java/com/google/api/gax/rpc/EndpointContext.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java index ce5cf8c786..03b2fdaeda 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java @@ -309,6 +309,17 @@ private String determineEndpoint() throws IOException { /** Determine if S2A can be used */ @VisibleForTesting boolean shouldUseS2A() { + // If running on windows or macos intel, skip S2A. S2A has runtime + // dependency on netty-tcnative which is dropping support on these platforms. + // https://github.com/netty/netty-tcnative/issues/898 + // https://github.com/netty/netty-tcnative/issues/897 + if (System.getProperty("os.name").contains("Windows") || + (System.getProperty("os.name").contains("OS X") + && System.getProperty("os.arch").contains("x86_64"))) { + return false; + } + + // If mTLS endpoint is not available, skip S2A if (Strings.isNullOrEmpty(mtlsEndpoint())) { return false; From 628fe31ce25b403519bb594c83c345931bd72a4f Mon Sep 17 00:00:00 2001 From: Riya Mehta Date: Tue, 10 Jun 2025 16:34:35 -0700 Subject: [PATCH 2/2] format --- .../java/com/google/api/gax/rpc/EndpointContext.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java index b6c6e4ee80..daf1246df6 100644 --- a/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java +++ b/gax-java/gax/src/main/java/com/google/api/gax/rpc/EndpointContext.java @@ -309,17 +309,16 @@ private String determineEndpoint() throws IOException { /** Determine if S2A can be used */ @VisibleForTesting boolean shouldUseS2A() { - // If running on windows or macos intel, skip S2A. S2A has runtime + // If running on windows or macos intel, skip S2A. S2A has runtime // dependency on netty-tcnative which is dropping support on these platforms. // https://github.com/netty/netty-tcnative/issues/898 // https://github.com/netty/netty-tcnative/issues/897 - if (System.getProperty("os.name").contains("Windows") || - (System.getProperty("os.name").contains("OS X") - && System.getProperty("os.arch").contains("x86_64"))) { - return false; + if (System.getProperty("os.name").contains("Windows") + || (System.getProperty("os.name").contains("OS X") + && System.getProperty("os.arch").contains("x86_64"))) { + return false; } - // If mTLS endpoint is not available, skip S2A if (Strings.isNullOrEmpty(mtlsEndpoint())) { return false;