hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject [hadoop] branch branch-3.0 updated: HDFS-13730. BlockReaderRemote.sendReadResult throws NPE. Contributed by Yuanbo Liu.
Date Tue, 18 Jun 2019 03:21:58 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 79f8e4d  HDFS-13730. BlockReaderRemote.sendReadResult throws NPE. Contributed by
Yuanbo Liu.
79f8e4d is described below

commit 79f8e4d5bc3afaff2f352b918e96a6ef3c2abcce
Author: Wei-Chiu Chuang <weichiu@apache.org>
AuthorDate: Mon Jun 17 20:18:53 2019 -0700

    HDFS-13730. BlockReaderRemote.sendReadResult throws NPE. Contributed by Yuanbo Liu.
    
    (cherry picked from commit 62ad9885ea8c75c134de43a3a925c76b253658e1)
    (cherry picked from commit 45543ffd6af723bb83bd44a99f12165363c70abb)
    (cherry picked from commit fc8983a5b8c94746d3e58cc203974aa09c1b640b)
---
 .../src/main/java/org/apache/hadoop/hdfs/net/BasicInetPeer.java       | 4 +++-
 .../src/main/java/org/apache/hadoop/hdfs/net/NioInetPeer.java         | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/BasicInetPeer.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/BasicInetPeer.java
index f18c5a0..b9f4e24 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/BasicInetPeer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/BasicInetPeer.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.nio.channels.ReadableByteChannel;
 
 import org.apache.hadoop.net.unix.DomainSocket;
@@ -93,7 +94,8 @@ public class BasicInetPeer implements Peer {
 
   @Override
   public String getRemoteAddressString() {
-    return socket.getRemoteSocketAddress().toString();
+    SocketAddress address = socket.getRemoteSocketAddress();
+    return address == null ? null : address.toString();
   }
 
   @Override
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/NioInetPeer.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/NioInetPeer.java
index 23a45b7..164f31e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/NioInetPeer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/net/NioInetPeer.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.Socket;
+import java.net.SocketAddress;
 import java.nio.channels.ReadableByteChannel;
 
 import org.apache.hadoop.net.SocketInputStream;
@@ -96,7 +97,8 @@ public class NioInetPeer implements Peer {
 
   @Override
   public String getRemoteAddressString() {
-    return socket.getRemoteSocketAddress().toString();
+    SocketAddress address = socket.getRemoteSocketAddress();
+    return address == null ? null : address.toString();
   }
 
   @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message