ayushtkn commented on code in PR #4791:
URL: https://github.com/apache/hadoop/pull/4791#discussion_r953918255
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java:
##########
@@ -541,19 +541,23 @@ public static String parseSpecialValue(String content,
String key) {
* @return The actual client's machine.
*/
public static String getClientMachine(final String[] ipProxyUsers) {
+ String clientMachine = null;
String cc = clientInfoFromContext(ipProxyUsers);
if (cc != null) {
// if the rpc has a caller context of "clientIp:1.2.3.4,CLI",
// return "1.2.3.4" as the client machine.
String key = CallerContext.CLIENT_IP_STR +
CallerContext.Builder.KEY_VALUE_SEPARATOR;
- return parseSpecialValue(cc, key);
+ clientMachine = parseSpecialValue(cc, key);
}
- String clientMachine = Server.getRemoteAddress();
- if (clientMachine == null) { //not a RPC client
- clientMachine = "";
+ if (clientMachine == null) {
+ clientMachine = Server.getRemoteAddress();
+ if (clientMachine == null) { //not a RPC client
+ clientMachine = "";
+ }
}
+
Review Comment:
nit: unnecessary change
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]