Amend HBASE-14771 RpcServer#getRemoteAddress always returns null

This change has been reported to cause Phoenix's PhoenixIndexRpcSchedulerTest 
to fail
with a NPE


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/063d214f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/063d214f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/063d214f

Branch: refs/heads/branch-1.2
Commit: 063d214f91e93b0057416e6723de406b3fcbfe35
Parents: c2e6a71
Author: Andrew Purtell <[email protected]>
Authored: Fri Jan 15 17:32:43 2016 -0800
Committer: Andrew Purtell <[email protected]>
Committed: Fri Jan 15 19:27:17 2016 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/063d214f/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
index 8297e90..4797143 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java
@@ -2590,7 +2590,7 @@ public class RpcServer implements RpcServerInterface, 
ConfigurationObserver {
    */
   public static InetAddress getRemoteIp() {
     Call call = CurCall.get();
-    if (call != null && call.connection.socket != null) {
+    if (call != null && call.connection != null && call.connection.socket != 
null) {
       return call.connection.socket.getInetAddress();
     }
     return null;

Reply via email to