apurtell commented on a change in pull request #2669:
URL: https://github.com/apache/hbase/pull/2669#discussion_r526476777



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java
##########
@@ -186,6 +183,33 @@ private void spawnRenewalChore(final UserGroupInformation 
user) {
     authService.scheduleChore(AuthUtil.getAuthRenewalChore(user));
   }
 
+  /**
+   * Get a unique key for the rpc stub to the given server.
+   */
+  private String getStubKey(String serviceName, ServerName serverName) throws 
UnknownHostException {
+    // Sometimes, servers go down and they come back up with the same hostname 
but a different
+    // IP address. Force a resolution of the hostname by trying to instantiate 
an
+    // InetSocketAddress, and this way we will rightfully get a new stubKey.
+    // Also, include the hostname in the key so as to take care of those cases 
where the
+    // DNS name is different but IP address remains the same.
+    String hostname = serverName.getHostname();
+    int port = serverName.getPort();
+    // We used to ignore when the address was unresolvable but that makes no 
sense. It

Review comment:
       Ok, done. Lookup done upon first call and then cached there; or else an 
exception or failure indication is returned at that time. 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to