diff --git a/dora/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java b/dora/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java index aeb2d7afed88..312389b1a044 100644 --- a/dora/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java +++ b/dora/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java @@ -772,7 +772,7 @@ private CloseableResource acquireBlockWorkerClientInternal( .getRpcPortSocketAddress(workerNetAddress, context.getClusterConf()); GrpcServerAddress serverAddress = GrpcServerAddress.create(workerNetAddress.getHost(), address); final ClientPoolKey key = new ClientPoolKey(address, AuthenticationUtils - .getImpersonationUser(userState.getSubject(), context.getClusterConf())); + .getImpersonationUser(userState.getSubject(), context.getClusterConf()), workerNetAddress.getHost()); final ConcurrentHashMap poolMap = mBlockWorkerClientPoolMap; BlockWorkerClientPool pool = poolMap.computeIfAbsent( @@ -1035,10 +1035,14 @@ private List getWorkerAddresses() throws IOException { protected static class ClientPoolKey { private final SocketAddress mSocketAddress; private final String mUsername; + private final String mHostname; - public ClientPoolKey(SocketAddress socketAddress, String username) { + + public ClientPoolKey(SocketAddress socketAddress, String username, String hostname) { mSocketAddress = socketAddress; mUsername = username; + mHostname = hostname; + } @Override @@ -1056,7 +1060,8 @@ public boolean equals(Object o) { } ClientPoolKey that = (ClientPoolKey) o; return Objects.equal(mSocketAddress, that.mSocketAddress) - && Objects.equal(mUsername, that.mUsername); + && Objects.equal(mUsername, that.mUsername) + && Objects.equal(mHostname, that.mHostname); } @Override