abhinav-phi opened a new pull request, #16464: URL: https://github.com/apache/dubbo/pull/16464
Fixes #16460 **Root cause.** On a multi-homed host, an HTTP/3 (QUIC) client pointed at `tri://127.0.0.1:20000` dials a different address: `AbstractClient.getConnectAddress()` runs the URL host through `NetUtils.filterLocalHost()`, and `isInvalidLocalHost()` treats `127.*` / `localhost` as invalid, replacing them with `NetUtils.getLocalHost()` (e.g. the docker0 address from the issue: `172.18.0.1`). The wildcard-bound `NettyHttp3Server` then answers from the kernel-selected source interface (`10.1.0.215` in the issue's tcpdump), not from the dialed address, and QUIC clients drop handshake packets that come from a different address than they dialed — so the handshake retransmits until timeout. TCP-based transports tolerate the rewrite because responses follow the established connection; QUIC's address validation does not. **Changes** - `Http3Helper.getConnectAddress(URL)`: loopback hosts (`localhost`, `127.*`) are dialed exactly as configured; anyhost/empty still resolves to the local host as before, and non-loopback hosts pass through unchanged. - `NettyHttp3ConnectionClient` overrides `getConnectAddress()` to use it. The fix is deliberately scoped to the QUIC client: I did not change the shared `AbstractClient` rewrite, which long-standing TCP paths rely on. **Testing** - New unit tests (`Http3HelperTest`, 4 cases): loopback dialed verbatim, `0.0.0.0` still replaced with the local host, remote address unchanged — all pass via `./mvnw -pl dubbo-remoting/dubbo-remoting-http3 -am test -Dtest=Http3HelperTest`. - Module compiles clean; spotless/checkstyle clean. **Server-side half (out of scope here).** The issue also notes that a wildcard `NioDatagramChannel` answers from the kernel-routed interface when the client dials a *non-loopback* local address (e.g. `172.18.0.1`). Per-datagram source control (`IP_PKTINFO`-style) is not exposed by netty's QUIC codec today, so this PR fixes the reported end-to-end scenario (client honors the configured loopback address; on loopback the kernel answers from loopback, handshake completes). Cross-interface multi-homed dials remain a separate follow-up — happy to discuss direction. -- 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]
