smengcl opened a new pull request, #8878:
URL: https://github.com/apache/hadoop/pull/8878

   Generated-by: Claude Code (Opus 5.5)
   
   JIRA: https://issues.apache.org/jira/browse/YARN-12032
   
   ### Description of PR
   
   `RMNodeImpl` built the node RPC and HTTP addresses as `hostName + ":" + 
port`. When a NodeManager host has no reverse DNS, its NodeId host is a numeric 
IPv6 literal, so the HTTP address became `2001:db8:0:0:0:0:0:21:8042`. That 
value is `Container.getNodeHttpAddress()`, `NodeReport.getHttpAddress()` and 
the REST `nodeHTTPAddress`. `NetUtils.createSocketAddr` rejects it, so the MR 
AM fails when a container launches, and `new URL("http://"; + address)` throws, 
which breaks node and log links in the web UI and the log redirect.
   
   This change:
   
   - Builds both addresses in `RMNodeImpl` with `NetUtils.getHostPortString`, 
which brackets IPv6 literals. Host names, IPv4 literals and a null host give 
the same string as before.
   - `TaskImpl` took the shuffle host with 
`getNodeHttpAddress().split(":")[0]`, which would give `[2001` for a bracketed 
address. It now parses the address with `NetUtils.createSocketAddrUnresolved`, 
the same parser `TaskAttemptImpl` already applies to this value when the 
container launches, and rebuilds `host:port` with `getHostPortString`.
   - `TaskAttemptImpl.recover` rebuilds the node HTTP address from job history 
the same way, so the recovered value stays parseable by the new `TaskImpl` 
code. For IPv6 this path is still blocked one line earlier by 
`NodeId.fromString`, which YARN-12033 covers.
   
   The consumers that split this value on `:` were checked. The others only 
display it, prefix a scheme, or parse it with `NetUtils.createSocketAddr`, 
which accepts brackets.
   
   ### How was this patch tested?
   
   - `TestRMNodeTransitions#testNodeAddressesBracketIPv6Host` (new): fails 
without the fix with `expected: <[2001:db8:0:0:0:0:0:21]:45454> but was: 
<2001:db8:0:0:0:0:0:21:45454>`. It also checks that host name and IPv4 
addresses are unchanged.
   - `TestTaskImpl#testMapOutputServerAddress` (new): fails without the 
`TaskImpl` change with `http://[2001:13562` and checks the host name case.
   - `TestRMNodeTransitions`, `TestRMWebServicesNodes`, 
`TestResourceTrackerService`, `TestTaskImpl`, `TestTaskAttempt` and 
`TestRecovery` pass.
   - Not run on a cluster.
   
   ### For code changes:
   
   - [x] Does the title or this PR starts 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?
   
   🤖 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]

Reply via email to