ptupitsyn commented on code in PR #3297:
URL: https://github.com/apache/ignite-3/pull/3297#discussion_r1507378067


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/ClientHandlerModule.java:
##########
@@ -313,32 +313,41 @@ protected void initChannel(Channel ch) {
                 .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
configuration.connectTimeout());
 
         int port = configuration.port();
+        String address = configuration.listenAddress();
+
+        ChannelFuture channelFuture = address.isEmpty() ? bootstrap.bind(port) 
: bootstrap.bind(address, port);
 
-        bootstrap.bind(port).addListener((ChannelFutureListener) bindFut -> {
+        channelFuture.addListener((ChannelFutureListener) bindFut -> {
             if (bindFut.isSuccess()) {
                 if (LOG.isInfoEnabled()) {
-                    LOG.info("Thin client connector endpoint started 
successfully [port={}]", port);
+                    LOG.info(
+                            "Thin client connector endpoint started 
successfully [{}]",
+                            (address.isEmpty() ? "" : "address=" + address + 
",") + "port=" + port);
                 }
 
                 result.complete(bindFut.channel());
-                return;
-            }
-
-            if (bindFut.cause() instanceof BindException) {
+            } else if (bindFut.cause() instanceof BindException) {
+                //TODO IGNITE-21614
                 result.completeExceptionally(
                         new IgniteException(
                                 PORT_IN_USE_ERR,
                                 "Cannot start thin client connector endpoint. 
Port " + port + " is in use.",
                                 bindFut.cause())
                 );
-                return;
+            } else if (bindFut.cause() instanceof UnresolvedAddressException) {
+                result.completeExceptionally(
+                        new IgniteException(
+                                INTERNAL_ERR,

Review Comment:
   Let's create a dedicated error code like we have for "port in use" 
situation, this is a problem caused by the user-defined configuration, not an 
"internal error".



-- 
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]

Reply via email to