smengcl commented on code in PR #8955:
URL: https://github.com/apache/hadoop/pull/8955#discussion_r4499874275


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/log/AggregatedLogsBlock.java:
##########
@@ -135,8 +136,10 @@ private String getApplicationLogURL(ApplicationId 
applicationId) {
     String webAppURLWithoutScheme =
         WebAppUtils.getNMWebAppURLWithoutScheme(conf);
     if (webAppURLWithoutScheme.contains(":")) {
-      String httpPort = webAppURLWithoutScheme.split(":")[1];
-      nodeId = NodeId.fromString(nodeId).getHost() + ":" + httpPort;
+      String httpPort =
+          
webAppURLWithoutScheme.substring(webAppURLWithoutScheme.lastIndexOf(':') + 1);
+      nodeId = NetUtils.getHostPortString(NodeId.fromString(nodeId).getHost(),
+          Integer.parseInt(httpPort));

Review Comment:
   Fixed in 300bf37d6da: the NM web address is now parsed with `HostAndPort`, 
the URL is left out when it has no port or cannot be parsed, and it is only 
built in the two branches that show it. `testApplicationLogUrlBracketsIPv6Host` 
now also covers `[::1]`, which threw `NumberFormatException` before.
   
   _🤖 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]

Reply via email to