From d987fb10aa843c408c18087868ffa06ed37f20a4 Mon Sep 17 00:00:00 2001 From: Terry Wilson Date: Thu, 17 Aug 2023 18:05:15 -0700 Subject: [PATCH] api: ManagedChannelBuilder note about ipv6 scope id JDK bug. (#10503) Adds a note on how to avoid a JDK bug by converting an ipv6 scope ID to its numeric form. --- api/src/main/java/io/grpc/ManagedChannelBuilder.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/src/main/java/io/grpc/ManagedChannelBuilder.java b/api/src/main/java/io/grpc/ManagedChannelBuilder.java index fd09ac9b82..ecae7b9207 100644 --- a/api/src/main/java/io/grpc/ManagedChannelBuilder.java +++ b/api/src/main/java/io/grpc/ManagedChannelBuilder.java @@ -32,6 +32,11 @@ public abstract class ManagedChannelBuilder> /** * Creates a channel with the target's address and port number. * + *

Note that there is an open JDK bug on {@link java.net.URI} class parsing an ipv6 scope ID: + * bugs.openjdk.org/browse/JDK-8199396. This method is exposed to this bug. If you experience an + * issue, a work-around is to convert the scope ID to its numeric form (e.g. by using + * Inet6Address.getScopeId()) before calling this method. + * * @see #forTarget(String) * @since 1.0.0 */ @@ -70,6 +75,11 @@ public abstract class ManagedChannelBuilder> *

  • {@code "[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443"}
  • * * + *

    Note that there is an open JDK bug on {@link java.net.URI} class parsing an ipv6 scope ID: + * bugs.openjdk.org/browse/JDK-8199396. This method is exposed to this bug. If you experience an + * issue, a work-around is to convert the scope ID to its numeric form (e.g. by using + * Inet6Address.getScopeId()) before calling this method. + * * @since 1.0.0 */ public static ManagedChannelBuilder forTarget(String target) {