Skip to content

Commit aab9e0b

Browse files
committed
HDFS-15250. Setting dfs.client.use.datanode.hostname to true can crash the system because of unhandled UnresolvedAddressException. Contributed by Ctest.
1 parent cb64e99 commit aab9e0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.io.IOException;
2828
import java.lang.reflect.Constructor;
2929
import java.net.InetSocketAddress;
30+
import java.nio.channels.UnresolvedAddressException;
3031
import java.util.List;
3132

3233
import com.google.common.io.ByteArrayDataOutput;
@@ -823,7 +824,7 @@ private BlockReaderPeer nextTcpPeer() throws IOException {
823824
datanode);
824825
LOG.trace("nextTcpPeer: created newConnectedPeer {}", peer);
825826
return new BlockReaderPeer(peer, false);
826-
} catch (IOException e) {
827+
} catch (IOException | UnresolvedAddressException e) {
827828
LOG.trace("nextTcpPeer: failed to create newConnectedPeer connected to"
828829
+ "{}", datanode);
829830
throw e;

0 commit comments

Comments
 (0)