You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/04/10 20:15:26 UTC

svn commit: r1311899 - /hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java

Author: stack
Date: Tue Apr 10 18:15:25 2012
New Revision: 1311899

URL: http://svn.apache.org/viewvc?rev=1311899&view=rev
Log:
HBASE-5759 HBaseClient throws NullPointerException when EOFException should be used.

Modified:
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java?rev=1311899&r1=1311898&r2=1311899&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/ipc/HBaseClient.java Tue Apr 10 18:15:25 2012
@@ -24,6 +24,7 @@ import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
+import java.io.EOFException;
 import java.io.FilterInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -563,6 +564,11 @@ public class HBaseClient {
 
         // Read the call id.
         RpcResponse response = RpcResponse.parseDelimitedFrom(in);
+        if (response == null) {
+          // When the stream is closed, protobuf doesn't raise an EOFException,
+          // instead, it returns a null message object. 
+          throw new EOFException();
+        }
         int id = response.getCallId();
 
         if (LOG.isDebugEnabled())