Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using unavailable worker cached in client-pool to resolve #18693 #18694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ private CloseableResource<BlockWorkerClient> 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<ClientPoolKey, BlockWorkerClientPool> poolMap =
mBlockWorkerClientPoolMap;
BlockWorkerClientPool pool = poolMap.computeIfAbsent(
Expand Down Expand Up @@ -1035,10 +1035,14 @@ private List<WorkerNetAddress> 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
Expand All @@ -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
Expand Down