Copilot commented on code in PR #8981:
URL: https://github.com/apache/hadoop/pull/8981#discussion_r4559878696


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-web-proxy/src/main/java/org/apache/hadoop/yarn/server/webproxy/WebAppProxy.java:
##########
@@ -69,8 +70,7 @@ protected void serviceInit(Configuration conf) throws 
Exception {
           " of " + auth);
     }
     String proxy = WebAppUtils.getProxyHostAndPort(conf);
-    String[] proxyParts = proxy.split(":");
-    proxyHost = proxyParts[0];
+    proxyHost = HostAndPort.fromString(proxy).getHost();

Review Comment:
   Parsing `proxyHost` here fixes only the servlet attribute; `serviceInit` 
still parses the same `PROXY_ADDRESS` with `StringUtils.split(bindAddress, 
':')` below. For `[2001:db8::1]:1000`, that produces more than two parts, so 
`bindAddress` remains the bracketed host-and-port string and `port` stays 0; 
`serviceStart` then constructs the endpoint from the wrong address instead of 
listening on the configured IPv6 proxy port. Parse the bind address with 
`HostAndPort` as well (preserving the no-port/ephemeral-port behavior) and add 
a startup regression test.



-- 
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