HDFS-15250. Setting `dfs.client.use.datanode.hostname` to true can crash the system because of unhandled UnresolvedAddressException. Contributed by Ctest.
This commit is contained in:
parent
8988f33ac3
commit
86c15b8287
|
@ -27,6 +27,7 @@ import java.io.FileInputStream;
|
|||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.nio.channels.UnresolvedAddressException;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.io.ByteArrayDataOutput;
|
||||
|
@ -823,7 +824,7 @@ public class BlockReaderFactory implements ShortCircuitReplicaCreator {
|
|||
datanode);
|
||||
LOG.trace("nextTcpPeer: created newConnectedPeer {}", peer);
|
||||
return new BlockReaderPeer(peer, false);
|
||||
} catch (IOException e) {
|
||||
} catch (IOException | UnresolvedAddressException e) {
|
||||
LOG.trace("nextTcpPeer: failed to create newConnectedPeer connected to"
|
||||
+ "{}", datanode);
|
||||
throw e;
|
||||
|
|
Loading…
Reference in New Issue