This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 6ccb1cd  HDFS-15250. Setting `dfs.client.use.datanode.hostname` to 
true can crash the system because of unhandled UnresolvedAddressException. 
Contributed by Ctest.
6ccb1cd is described below

commit 6ccb1cd5f1658ece5be0543eb9ca89caa24bf37e
Author: Ayush Saxena <[email protected]>
AuthorDate: Sun May 10 11:43:04 2020 +0530

    HDFS-15250. Setting `dfs.client.use.datanode.hostname` to true can crash 
the system because of unhandled UnresolvedAddressException. Contributed by 
Ctest.
---
 .../java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java
 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java
index 2109e6e..a3b611c 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/client/impl/BlockReaderFactory.java
@@ -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;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to