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 <aajisaka@apache.org> (cherry picked from commit 07530314c2130ecd1525682c59bf51f15b82c024)
This commit is contained in:
parent
2478d333a6
commit
7418764a67
@ -27,8 +27,7 @@
|
|||||||
public class IpcException extends IOException {
|
public class IpcException extends IOException {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
final String errMsg;
|
|
||||||
public IpcException(final String err) {
|
public IpcException(final String err) {
|
||||||
errMsg = err;
|
super(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2040,7 +2040,7 @@ private void doSaslReply(Message message) throws IOException {
|
|||||||
private void doSaslReply(Exception ioe) throws IOException {
|
private void doSaslReply(Exception ioe) throws IOException {
|
||||||
setupResponse(authFailedCall,
|
setupResponse(authFailedCall,
|
||||||
RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_UNAUTHORIZED,
|
RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_UNAUTHORIZED,
|
||||||
null, ioe.getClass().getName(), ioe.getLocalizedMessage());
|
null, ioe.getClass().getName(), ioe.toString());
|
||||||
sendResponse(authFailedCall);
|
sendResponse(authFailedCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2435,7 +2435,8 @@ private void processOneRpc(ByteBuffer bb)
|
|||||||
final RpcCall call = new RpcCall(this, callId, retry);
|
final RpcCall call = new RpcCall(this, callId, retry);
|
||||||
setupResponse(call,
|
setupResponse(call,
|
||||||
rse.getRpcStatusProto(), rse.getRpcErrorCodeProto(), null,
|
rse.getRpcStatusProto(), rse.getRpcErrorCodeProto(), null,
|
||||||
t.getClass().getName(), t.getMessage());
|
t.getClass().getName(),
|
||||||
|
t.getMessage() != null ? t.getMessage() : t.toString());
|
||||||
sendResponse(call);
|
sendResponse(call);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user