smengcl commented on code in PR #8981:
URL: https://github.com/apache/hadoop/pull/8981#discussion_r4607036067
##########
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:
Done in dd7bfecc8bd: `AmFilterInitializer` now builds each `RM_HA_URLS`
entry with `WebAppUtils.getResolvedAddress(NetUtils.createSocketAddr(...))`,
the same resolution `getProxyHostsAndPortsForAmFilter` uses for
`PROXY_URI_BASES`, so both sides have the same host:port form (falling back to
the configured string if it cannot be parsed).
`TestAmFilterInitializer#testInitFilter` adds two IPv6 RMs and checks every
`RM_HA_URLS` entry matches a `PROXY_URI_BASES` key as `AmIpFilter` builds them;
without the fix it gets `[2001:db8:0:0:0:0:0:1]:2000` vs `[2001:db8::1]:2000".
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
##########
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:
Done in dd7bfecc8bd: `AmFilterInitializer` now builds each `RM_HA_URLS`
entry with `WebAppUtils.getResolvedAddress(NetUtils.createSocketAddr(...))`,
the same resolution `getProxyHostsAndPortsForAmFilter` uses for
`PROXY_URI_BASES`, so both sides have the same host:port form (falling back to
the configured string if it cannot be parsed).
`TestAmFilterInitializer#testInitFilter` adds two IPv6 RMs and checks every
`RM_HA_URLS` entry matches a `PROXY_URI_BASES` key as `AmIpFilter` builds them;
without the fix it gets `[2001:db8:0:0:0:0:0:1]:2000` vs `[2001:db8::1]:2000`.
_🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
--
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]