slfan1989 commented on code in PR #8955:
URL: https://github.com/apache/hadoop/pull/8955#discussion_r4499864288
##########
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:
Thanks for fixing the IPv6 URL formatting. Could we handle NM webapp
addresses without an explicit port here? WebApps.Builder accepts `[::1]` and
picks an available port, but this code tries to parse `1]` as the port and
throws NumberFormatException.
Since the fallback URL is built before the aggregated logs are read, this
prevents the page from rendering even when the logs are available. Could we
build the URL only when the fallback is needed and omit it if the NM web port
cannot be determined?
--
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]