virajjasani commented on a change in pull request #1921:
URL: https://github.com/apache/hbase/pull/1921#discussion_r441562375



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java
##########
@@ -148,6 +148,18 @@ public boolean saslConnect(InputStream inS, OutputStream 
outS) throws IOExceptio
           inStream.readFully(saslToken);
         }
       }
+
+      if(isComplete()){
+        try {
+          readStatus(inStream);
+        }
+        catch (Exception e){

Review comment:
       Why not just catch `IOException` ?

##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java
##########
@@ -148,6 +148,18 @@ public boolean saslConnect(InputStream inS, OutputStream 
outS) throws IOExceptio
           inStream.readFully(saslToken);
         }
       }
+
+      if(isComplete()){
+        try {
+          readStatus(inStream);
+        }
+        catch (Exception e){
+          if(e instanceof RemoteException){
+            LOG.debug("Sasl connection failed: ", e);

Review comment:
       Good to log at error level?

##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/security/HBaseSaslRpcClient.java
##########
@@ -148,6 +148,18 @@ public boolean saslConnect(InputStream inS, OutputStream 
outS) throws IOExceptio
           inStream.readFully(saslToken);
         }
       }
+
+      if(isComplete()){
+        try {
+          readStatus(inStream);
+        }
+        catch (Exception e){
+          if(e instanceof RemoteException){
+            LOG.debug("Sasl connection failed: ", e);
+            throw e;

Review comment:
       This should be out of if condition right? Don't we want to re-throw 
`IOException` other than `RemoteException`?
   Which brings the question, why to even have if condition? I know 
`RemoteException` coming from `readStatus` is imp to us but we don't want to 
swallow IOException if `inStream.readInt()` throws one.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to