smengcl opened a new pull request, #8920: URL: https://github.com/apache/hadoop/pull/8920
Generated-by: Claude Code (Opus 5.5) JIRA: https://issues.apache.org/jira/browse/MAPREDUCE-7549 ### Description of PR `TaskAttemptImpl.resolveHosts` resolves split hosts that are IP literals to host names, so they match the host the NodeManager registers. `isIP` only matched IPv4, so an IPv6 literal split host such as `2001:db8::21` was kept as is, while the NodeManager registers `2001:db8:0:0:0:0:0:21` or its PTR name. The strings never match, so the request is never node local and the locality counters are wrong. This patch makes `isIP` also accept IPv6 literals through `InetAddresses.isInetAddress`. The existing IPv4 regex stays, so IPv4 behavior does not change (Guava alone would reject leading zero octets such as `010.1.1.1`, which the regex accepts). ### How was this patch tested? Added `TestTaskAttempt#testResolveHostsIPv6Literal`: an IPv4 literal and an IPv6 literal split host are both passed to `resolveHost`, and a host name is not. Without the fix the IPv6 literal is returned unresolved and the test fails. `TestTaskAttempt` passes locally. ### For code changes: - [x] Does the title of this PR start with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? - [ ] Object storage: Have the integration tests been executed and the endpoint declared according to the connector-specific documentation? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? ### AI Tooling - [x] The PR includes the phrase "Contains content generated by Claude Code (Opus 5.5)". - [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 (Opus 5.5). 🤖 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]
