smengcl opened a new pull request, #8981: URL: https://github.com/apache/hadoop/pull/8981
Generated-by: Claude Code (Opus 5.5) JIRA: https://issues.apache.org/jira/browse/YARN-12061 ### Description of PR `AmFilterInitializer`, `WebAppProxy`, `ResourceManager` and `Router` get the web proxy host with `proxy.split(":")[0]`. With an IPv6 proxy or RM web address such as `[2001:db8::1]:8088` (the form `WebAppUtils.getResolvedAddress` returns since YARN-12034), the host becomes `[2001`. `AmIpFilter` then cannot match requests from the proxy, and `WebAppProxyServlet` fails in `InetAddress.getByName(proxyHost)` when it sets the local address for proxied requests. This patch parses the host with `HostAndPort.fromString(...).getHost()` (shaded Guava, already used in YARN). It returns `2001:db8::1` for a bracketed IPv6 literal. Hostname and IPv4 output is unchanged. ### How was this patch tested? Added an IPv6 `PROXY_ADDRESS` case to `TestAmFilterInitializer#testInitFilter`. Without the fix it fails with `expected: <2001:db8::1> but was: <[2001>`; with it, it passes. `TestAmFilterInitializer`, `TestAmFilter`, `TestWebAppProxyServer` and `TestWebAppProxyServlet` pass locally, and the RM and Router modules compile. The other three call sites use the same one-line expression. ### For code changes: - [x] Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? ### AI Tooling - [x] The PR includes the phrase "Contains content generated by Claude Code". - [x] My use of AI contributions follows the ASF legal policy https://www.apache.org/legal/generative-tooling.html Contains content generated by Claude Code. 🤖 Generated with [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]
