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: [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]