You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/07/29 15:29:15 UTC
[GitHub] [hadoop] jianghuazhu commented on a diff in pull request #4659: HDFS-16700. RBF: Record the real client IP carried by the Router in the NameNode log
jianghuazhu commented on code in PR #4659:
URL: https://github.com/apache/hadoop/pull/4659#discussion_r933386616
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterRpc.java:
##########
@@ -2070,6 +2071,23 @@ public void testSetBalancerBandwidth() throws Exception {
}, 100, 60 * 1000);
}
+ @Test
+ public void testRecordRealClientIp() {
+ GenericTestUtils.LogCapturer logger =
+ GenericTestUtils.LogCapturer.captureLogs(Server.LOG);
+ CallerContext.setCurrent(
+ new CallerContext.Builder(
+ "clientContext,clientIp:2.2.2.2,clientPort:1234").build());
+ try {
+ String filePath = "/test/f.log";
+ routerProtocol.getBlockLocations(filePath, 0, 100);
+ } catch (Exception e) {
+ // do nothing
+ } finally {
+ assertTrue(logger.getOutput().contains("2.2.2.2:1234"));
Review Comment:
Thanks @goiri for the comment and review.
I will update later.
--
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: common-issues-unsubscribe@hadoop.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org