From da68e0b49fa74a88db1a50813d84648a1f6f8604 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 19 Dec 2023 09:46:03 -0800 Subject: [PATCH 1/8] No-op proxy detector for xDS gRPC channel builder --- d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java b/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java index 2eed5f82d0..d8923e1291 100644 --- a/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java +++ b/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java @@ -17,6 +17,7 @@ package com.linkedin.d2.xds; import io.grpc.ManagedChannel; +import io.grpc.internal.GrpcUtil; import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder; import io.grpc.netty.shaded.io.netty.handler.ssl.SslContext; import java.util.concurrent.TimeUnit; @@ -53,6 +54,7 @@ public ManagedChannel createChannel() } return builder.keepAliveTime(5, TimeUnit.MINUTES) + .proxyDetector(GrpcUtil.NOOP_PROXY_DETECTOR) .build(); } } From a667446f1b8a95ce80d0edb92fabfbdde37d8ca7 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 19 Dec 2023 09:51:32 -0800 Subject: [PATCH 2/8] Update changelog --- CHANGELOG.md | 6 +++++- gradle.properties | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16eebea446..55519b373c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and what APIs have changed, if applicable. ## [Unreleased] +## [29.48.7] - 2023-12-19 +- No-op proxy detector for xDS gRPC channel builder. + ## [29.48.6] - 2023-12-12 - Rename next to nextPageToken in standardized models for cursor based pagination @@ -5581,7 +5584,8 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.48.6...master +[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.48.7...master +[29.48.7]: https://github.com/linkedin/rest.li/compare/v29.48.6...v29.48.7 [29.48.6]: https://github.com/linkedin/rest.li/compare/v29.48.5...v29.48.6 [29.48.5]: https://github.com/linkedin/rest.li/compare/v29.48.4...v29.48.5 [29.48.4]: https://github.com/linkedin/rest.li/compare/v29.48.3...v29.48.4 diff --git a/gradle.properties b/gradle.properties index fa61d7d558..6aa5d80776 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.48.6 +version=29.48.7 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true From bac6038f22232a32c98ff5c61a91def3e80843de Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 19 Dec 2023 10:38:05 -0800 Subject: [PATCH 3/8] Warning for unsupported zero-allocation-hashing library versions --- CHANGELOG.md | 1 + .../d2/balancer/util/hashing/MPConsistentHashRing.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55519b373c..9cbd06de1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and what APIs have changed, if applicable. ## [29.48.7] - 2023-12-19 - No-op proxy detector for xDS gRPC channel builder. +- Warning for unsupported `zero-allocation-hashing` library versions. ## [29.48.6] - 2023-12-12 - Rename next to nextPageToken in standardized models for cursor based pagination diff --git a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java index a634e482d2..a526aa34e1 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java @@ -49,6 +49,15 @@ */ public class MPConsistentHashRing implements Ring { + static { + try { + LongHashFunction.class.getMethod("xx_r39", long.class); + } catch (NoSuchMethodException ex) { + // SI-36497 + throw new RuntimeException("Required method xx_39 not found, this means an supported version of the " + + "zero-allocation-hashing library is being used. Do not use later than 0.0.7 if you want to use pegasus"); + } + } public static final int DEFAULT_NUM_PROBES = 21; public static final int DEFAULT_POINTS_PER_HOST = 1; From 721bff29cb39849e825509b398c8f6bc0681532c Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 19 Dec 2023 13:04:42 -0800 Subject: [PATCH 4/8] Log instead of just throwing --- .../balancer/util/hashing/MPConsistentHashRing.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java index a526aa34e1..48c285327b 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java @@ -49,19 +49,20 @@ */ public class MPConsistentHashRing implements Ring { + public static final int DEFAULT_NUM_PROBES = 21; + public static final int DEFAULT_POINTS_PER_HOST = 1; + + private static final Logger LOG = LoggerFactory.getLogger(ConsistentHashRing.class); static { try { LongHashFunction.class.getMethod("xx_r39", long.class); } catch (NoSuchMethodException ex) { // SI-36497 - throw new RuntimeException("Required method xx_39 not found, this means an supported version of the " - + "zero-allocation-hashing library is being used. Do not use later than 0.0.7 if you want to use pegasus"); + LOG.error("Required method xx_39 not found, this means an supported version of the " + + "zero-allocation-hashing library is being used. Do not use later than 0.7 if you want to use pegasus", ex); + throw new RuntimeException(ex); } } - public static final int DEFAULT_NUM_PROBES = 21; - public static final int DEFAULT_POINTS_PER_HOST = 1; - - private static final Logger LOG = LoggerFactory.getLogger(ConsistentHashRing.class); private static final LongHashFunction HASH_FUNCTION_0 = LongHashFunction.xx_r39(0xDEADBEEF); private static final Charset UTF8 = Charset.forName("UTF-8"); /* we will only use the lower 32 bit of the hash code to avoid overflow */ From 41d81e859d49a0e14024a89b29f509100742b3ed Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 19 Dec 2023 14:07:40 -0800 Subject: [PATCH 5/8] Fixed comment --- .../linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java index 48c285327b..422ff0b21f 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java @@ -58,7 +58,7 @@ public class MPConsistentHashRing implements Ring LongHashFunction.class.getMethod("xx_r39", long.class); } catch (NoSuchMethodException ex) { // SI-36497 - LOG.error("Required method xx_39 not found, this means an supported version of the " + LOG.error("Required method xx_r39 not found, this means an unsupported version of the " + "zero-allocation-hashing library is being used. Do not use later than 0.7 if you want to use pegasus", ex); throw new RuntimeException(ex); } From 05e071727d99216b43e9e3e21c074a38814ab644 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Wed, 20 Dec 2023 10:47:38 -0800 Subject: [PATCH 6/8] Review suggestions --- .../linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java | 1 - d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java index 422ff0b21f..a235340041 100644 --- a/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java +++ b/d2/src/main/java/com/linkedin/d2/balancer/util/hashing/MPConsistentHashRing.java @@ -57,7 +57,6 @@ public class MPConsistentHashRing implements Ring try { LongHashFunction.class.getMethod("xx_r39", long.class); } catch (NoSuchMethodException ex) { - // SI-36497 LOG.error("Required method xx_r39 not found, this means an unsupported version of the " + "zero-allocation-hashing library is being used. Do not use later than 0.7 if you want to use pegasus", ex); throw new RuntimeException(ex); diff --git a/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java b/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java index d8923e1291..f0a3b01880 100644 --- a/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java +++ b/d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java @@ -54,6 +54,7 @@ public ManagedChannel createChannel() } return builder.keepAliveTime(5, TimeUnit.MINUTES) + // No proxy wanted here; the default proxy detector can mistakenly detect forwarded ports as proxies. .proxyDetector(GrpcUtil.NOOP_PROXY_DETECTOR) .build(); } From ffa66bf33eaf4417029d87c2eadacb47a288b52c Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Wed, 20 Dec 2023 10:53:44 -0800 Subject: [PATCH 7/8] Updated changelog --- CHANGELOG.md | 8 +++++++- gradle.properties | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b569a6f45..a1c5a399e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ and what APIs have changed, if applicable. ## [Unreleased] +## [29.48.9] - 2023-12-20 +- No-op proxy detector for xDS gRPC channel builder. +- Warning for unsupported `zero-allocation-hashing` library versions. + + ## [29.48.8] - 2023-12-19 - add warn logs about invalid property versions @@ -5587,7 +5592,8 @@ patch operations can re-use these classes for generating patch messages. ## [0.14.1] -[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.48.8...master +[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.48.9...master +[29.48.9]: https://github.com/linkedin/rest.li/compare/v29.48.8...v29.48.9 [29.48.8]: https://github.com/linkedin/rest.li/compare/v29.48.7...v29.48.8 [29.48.7]: https://github.com/linkedin/rest.li/compare/v29.48.6...v29.48.7 [29.48.6]: https://github.com/linkedin/rest.li/compare/v29.48.5...v29.48.6 diff --git a/gradle.properties b/gradle.properties index 2e9da9f38a..cf397bf3d4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version=29.48.8 +version=29.48.9 group=com.linkedin.pegasus org.gradle.configureondemand=true org.gradle.parallel=true From c76571aad192cbb8c930c3f0e3355877b339b936 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Wed, 20 Dec 2023 10:54:28 -0800 Subject: [PATCH 8/8] Remove extra newline --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c5a399e5..ad7d940cd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,6 @@ and what APIs have changed, if applicable. - No-op proxy detector for xDS gRPC channel builder. - Warning for unsupported `zero-allocation-hashing` library versions. - ## [29.48.8] - 2023-12-19 - add warn logs about invalid property versions