maomaodev commented on PR #7713:
URL: https://github.com/apache/kyuubi/pull/7713#issuecomment-5539675872

   @pan3793 Good catch! Fixed all three, and swept the codebase for the same 
pattern.
   
   **Your three:**
   
   - `ZookeeperDiscoveryClient.addConfsToPublish`: `split(":", 2)` → 
`IPStackUtils.getHostAndPort`.
   - `JettyServer` (`start` / `getServerUri`) & 
`KyuubiRestFrontendService.connectionUrl` (advertisedHost): → 
`IPStackUtils.concatHostPort`.
   - `Utils.java` L409/L422/L536: authority building → 
`IPStackUtils.concatHostPort` (which internally calls `formatIPAddressForURL` + 
validates host/port).
   
   **Also fixed (same bug elsewhere):**
   
   - `KyuubiTrinoFrontendService.connectionUrl` (advertisedHost branch).
   - `ServiceNodeInfo`: the `instance` string published to service discovery.
   - `EngineRef`: Data Agent JDBC URL.
   - `KyuubiConnection.getServerHttpUrl`: HTTP URL construction.
   - `KyuubiConfFileParser.addHosts`: `hosts` property fed to beeline JDBC URL 
builder.
   
   **Related:**
   
   - Ported Hive's `concatHostPort` (validates host/port) into `IPStackUtils` 
with UT mirroring Hive.
   - Narrowed `catch (Exception)` in `DiscoveryClient` to `catch 
(IllegalArgumentException)` per your earlier point.
   
   **Intentionally left alone** (all non-functional, happy to revisit if you 
disagree):
   
   - `KyuubiSessionImpl.scala`: 5 `s"$host:$port"` occurrences, all in `warn` / 
`info` / `error` / `logSessionInfo` messages — display only, no parsing 
downstream.
   - `KyuubiConnection.java`: `LOG.warn("Failed to connect to " + host + ":" + 
port)` and `logZkDiscoveryMessage("Connected to " + host + ":" + port)` — same, 
log-only.
   - `TBinaryFrontendService.scala` / `KyuubiTHttpFrontendService.scala`: 
`s"Failed to initialize frontend service on $serverAddr:$portNum"` — exception 
message string, not consumed by any code path.
   - `EmbeddedZookeeper.scala`: `s"...binding to $host:$clientPort"` — 
exception message, real ZK connect string comes from `getConnectString`.
   - `EngineUIProxyServlet.scala` L87: `X-Forwarded-Context` header value is a 
path prefix, not a URL authority.
   - `HiveSiteHS2ConnectionFileParser.java` L215: Hive-side compatibility layer 
using `getHostName()` (returns hostname string, not a numeric address).


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