Repository: storm
Updated Branches:
  refs/heads/master becab7cc2 -> e99b53902


STORM-2833: Use the original host name when closing.


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/107a9c9a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/107a9c9a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/107a9c9a

Branch: refs/heads/master
Commit: 107a9c9ab34aebfabad646e8d30b51e94e3ae060
Parents: becab7c
Author: Robert (Bobby) Evans <[email protected]>
Authored: Mon Nov 27 11:09:35 2017 -0600
Committer: Jungtaek Lim <[email protected]>
Committed: Wed Nov 29 07:49:41 2017 +0900

----------------------------------------------------------------------
 .../src/jvm/org/apache/storm/messaging/netty/Client.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/107a9c9a/storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java
----------------------------------------------------------------------
diff --git a/storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java 
b/storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java
index dd07d60..fcaf4e5 100644
--- a/storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java
+++ b/storm-client/src/jvm/org/apache/storm/messaging/netty/Client.java
@@ -82,6 +82,10 @@ public class Client extends ConnectionWithStatus implements 
IStatefulObject, ISa
     private final ClientBootstrap bootstrap;
     private final InetSocketAddress dstAddress;
     protected final String dstAddressPrefixedName;
+    //The actual name of the host we are trying to connect to so that
+    // when we remove ourselves from the connection cache there is no concern 
that
+    // the resolved host name is different.
+    private final String dstHost;
     private volatile Map<Integer, Double> serverLoad = null;
 
     /**
@@ -157,6 +161,7 @@ public class Client extends ConnectionWithStatus implements 
IStatefulObject, ISa
 
         // Initiate connection to remote destination
         bootstrap = createClientBootstrap(factory, bufferSize, topoConf);
+        dstHost = host;
         dstAddress = new InetSocketAddress(host, port);
         dstAddressPrefixedName = prefixedName(dstAddress);
         launchChannelAliveThread();
@@ -426,7 +431,7 @@ public class Client extends ConnectionWithStatus implements 
IStatefulObject, ISa
     public void close() {
         if (!closing) {
             LOG.info("closing Netty Client {}", dstAddressPrefixedName);
-            
context.removeClient(dstAddress.getHostName(),dstAddress.getPort());
+            context.removeClient(dstHost, dstAddress.getPort());
             // Set closing to true to prevent any further reconnection 
attempts.
             closing = true;
             waitForPendingMessagesToBeSent();

Reply via email to