You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2019/07/26 08:56:38 UTC

[hadoop] branch branch-2.9 updated: HADOOP-9844. NPE when trying to create an error message response of SASL RPC

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

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


The following commit(s) were added to refs/heads/branch-2.9 by this push:
     new 5ec4108  HADOOP-9844. NPE when trying to create an error message response of SASL RPC
5ec4108 is described below

commit 5ec4108d91e64f6837610f3a9670f780d1938071
Author: Steve Loughran <st...@apache.org>
AuthorDate: Fri Oct 13 13:31:01 2017 +0100

    HADOOP-9844. NPE when trying to create an error message response of SASL RPC
    
    This closes #55
    
    Change-Id: I10a20380565fa89762f4aa564b2f1c83b9aeecdc
    Signed-off-by: Akira Ajisaka <aa...@apache.org>
    (cherry picked from commit 07530314c2130ecd1525682c59bf51f15b82c024)
    (cherry picked from commit c0fd09c42ced09a25914195e38d1c7d581a105dd)
---
 .../src/main/java/org/apache/hadoop/ipc/IpcException.java            | 5 ++---
 .../hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java    | 5 +++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java
index e55eda9..61c42b8 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java
@@ -26,9 +26,8 @@ import java.io.IOException;
  */
 public class IpcException extends IOException {
   private static final long serialVersionUID = 1L;
-  
-  final String errMsg;
+
   public IpcException(final String err) {
-    errMsg = err; 
+    super(err);
   }
 }
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
index 1d5292c..2aa746a 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
@@ -1947,7 +1947,7 @@ public abstract class Server {
     private void doSaslReply(Exception ioe) throws IOException {
       setupResponse(authFailedCall,
           RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_UNAUTHORIZED,
-          null, ioe.getClass().getName(), ioe.getLocalizedMessage());
+          null, ioe.getClass().getName(), ioe.toString());
       sendResponse(authFailedCall);
     }
 
@@ -2306,7 +2306,8 @@ public abstract class Server {
         final RpcCall call = new RpcCall(this, callId, retry);
         setupResponse(call,
             rse.getRpcStatusProto(), rse.getRpcErrorCodeProto(), null,
-            t.getClass().getName(), t.getMessage());
+            t.getClass().getName(),
+            t.getMessage() != null ? t.getMessage() : t.toString());
         sendResponse(call);
       }
     }


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