Skip to content

Commit b94eba9

Browse files
committed
HADOOP-12282. Connection thread's name should be updated after address changing is detected. Contributed by Lisheng Sun.
1 parent 32607db commit b94eba9

File tree

1 file changed

+4
-0
lines changed
  • hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc

1 file changed

+4
-0
lines changed

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ private synchronized boolean updateAddress() throws IOException {
638638
LOG.warn("Address change detected. Old: " + server.toString() +
639639
" New: " + currentAddr.toString());
640640
server = currentAddr;
641+
UserGroupInformation ticket = remoteId.getTicket();
642+
this.setName("IPC Client (" + socketFactory.hashCode()
643+
+ ") connection to " + server.toString() + " from "
644+
+ ((ticket == null) ? "an unknown user" : ticket.getUserName()));
641645
return true;
642646
}
643647
return false;

0 commit comments

Comments
 (0)