ennuite commented on code in PR #1027:
URL: https://github.com/apache/arrow-java/pull/1027#discussion_r3891075998
##########
flight/flight-core/src/main/java/org/apache/arrow/flight/grpc/NettyClientBuilder.java:
##########
@@ -139,7 +139,12 @@ public NettyChannelBuilder build() {
case LocationSchemes.GRPC_INSECURE:
case LocationSchemes.GRPC_TLS:
{
- builder = NettyChannelBuilder.forAddress(location.toSocketAddress());
+ final int port = location.getUri().getPort();
+ if (port < 0 || port > 65535) {
+ throw new IllegalArgumentException(
Review Comment:
Yes, but it wasn't gRPC that used to throw for us.
Details:
`location.toSocketAddress())` is at
https://github.com/apache/arrow-java/blob/4e8faf74a3081663b68634d5ab33d81c52c46319/flight/flight-core/src/main/java/org/apache/arrow/flight/Location.java#L67
The call to
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/InetSocketAddress.html#%3Cinit%3E(java.lang.String,int)
throws IllegalArgumentException when the port is smaller than 0 or greater
than 65535 (you can find that in the linked Javadoc).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]