HDFS-1927. Fix a bug which causes ip=null in NameNode audit log. Contributed by John George
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@1124349 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 7461e71..31c3b3e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -593,6 +593,9 @@
HDFS-1881. Federation: after taking snapshot the current directory
of datanode is empty. (Tanping Wang via suresh)
+ HDFS-1927. Fix a bug which causes ip=null in NameNode audit log.
+ (John George via szetszwo)
+
Release 0.22.0 - Unreleased
INCOMPATIBLE CHANGES
diff --git a/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
index 866616d..87636e5 100644
--- a/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
+++ b/src/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
@@ -5415,12 +5415,11 @@
}
/**
- * If the remote IP for namenode method invokation is null, then the
- * invocation is internal to the namenode. Client invoked methods are invoked
- * over RPC and always have address != null.
+ * Client invoked methods are invoked over RPC and will be in
+ * RPC call context even if the client exits.
*/
private boolean isExternalInvocation() {
- return Server.getRemoteIp() != null;
+ return Server.isRpcInvocation();
}
/**