Skip to content

Commit

Permalink
Use no-op proxy detector for xDS gRPC managed channel builder (#957)
Browse files Browse the repository at this point in the history
* No-op proxy detector for xDS gRPC channel builder
* Warning for unsupported zero-allocation-hashing library versions
  • Loading branch information
shivamgupta1 authored Dec 20, 2023
1 parent d376000 commit 6b1cbb4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ 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

Expand Down Expand Up @@ -5587,7 +5591,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public class MPConsistentHashRing<T> implements Ring<T>
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) {
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);
}
}
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 */
Expand Down
3 changes: 3 additions & 0 deletions d2/src/main/java/com/linkedin/d2/xds/XdsChannelFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -53,6 +54,8 @@ 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();
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=29.48.8
version=29.48.9
group=com.linkedin.pegasus
org.gradle.configureondemand=true
org.gradle.parallel=true
Expand Down

0 comments on commit 6b1cbb4

Please sign in to comment.