HADOOP-16868. ipc.Server readAndProcess threw NullPointerException. Contributed by Tsz-wo Sze.

This commit is contained in:
Wei-Chiu Chuang 2020-02-18 21:53:08 -08:00
parent 6526f95bd2
commit cb3f3cca01

View File

@ -1794,7 +1794,7 @@ public class Connection {
private SocketChannel channel; private SocketChannel channel;
private ByteBuffer data; private ByteBuffer data;
private ByteBuffer dataLengthBuffer; private final ByteBuffer dataLengthBuffer;
private LinkedList<RpcCall> responseQueue; private LinkedList<RpcCall> responseQueue;
// number of outstanding rpcs // number of outstanding rpcs
private AtomicInteger rpcCount = new AtomicInteger(); private AtomicInteger rpcCount = new AtomicInteger();
@ -2838,7 +2838,6 @@ public void setServiceClass(int serviceClass) {
private synchronized void close() { private synchronized void close() {
disposeSasl(); disposeSasl();
data = null; data = null;
dataLengthBuffer = null;
if (!channel.isOpen()) if (!channel.isOpen())
return; return;
try {socket.shutdownOutput();} catch(Exception e) { try {socket.shutdownOutput();} catch(Exception e) {