slfan1989 commented on code in PR #8981:
URL: https://github.com/apache/hadoop/pull/8981#discussion_r4606950320


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/amfilter/AmFilterInitializer.java:
##########
@@ -45,7 +46,7 @@ public void initFilter(FilterContainer container, 
Configuration conf) {
     List<String> proxies = WebAppUtils.getProxyHostsAndPortsForAmFilter(conf);
     StringBuilder sb = new StringBuilder();
     for (String proxy : proxies) {
-      sb.append(proxy.split(":")[0]).append(AmIpFilter.PROXY_HOSTS_DELIMITER);
+      
sb.append(HostAndPort.fromString(proxy).getHost()).append(AmIpFilter.PROXY_HOSTS_DELIMITER);

Review Comment:
   Could we use the same host-and-port format for both sides of the RM HA 
redirect lookup? 
   
   With two RMs configured using compressed IPv6 literals and no standalone 
proxy, `PROXY_URI_BASES` contains expanded addresses such as 
`[2001:db8:0:0:0:0:0:1]:8088`, while RM_HA_URLS keeps `[2001:db8::1]:8088`. 
   
   `AmIpFilter.findRedirectUrl()` looks up the configured strings verbatim, so 
neither entry matches and the redirect fails. 
   
   Could we normalize the lookup keys consistently and add a test with two IPv6 
RM addresses?



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

Reply via email to