From 79588240c60bf422fb9d9a74e0edd8b47a66b9f9 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Fri, 15 Jan 2016 17:32:43 -0800 Subject: [PATCH] Amend HBASE-14771 RpcServer#getRemoteAddress always returns null This change has been reported to cause Phoenix's PhoenixIndexRpcSchedulerTest to fail with a NPE --- .../src/main/java/org/apache/hadoop/hbase/ipc/RpcServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 cdc97bfd118..bd3342ba15b 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 @@ -2603,7 +2603,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;