SURYAS1306 opened a new pull request, #16060: URL: https://github.com/apache/dubbo/pull/16060
## What is the purpose of the change? When Dubbo REST is configured to run in `server=servlet` mode, the servlet container (such as Tomcat or Jetty) is responsible for managing the server lifecycle and port binding. However, `Http3Exchanger.bind(URL)` still attempted to start an internal Netty HTTP/3 server in this mode. This can lead to port conflicts and unexpected behavior because two servers attempt to bind to the same port. This PR fixes the incorrect server startup behavior in REST servlet mode. Fixes #15273 --- ## What is changed? ### 1. Prevent HTTP/3 server startup in REST servlet mode A small guard is added in `Http3Exchanger.bind(URL)` to detect REST servlet deployments: - If the protocol is `rest` - And the URL parameter `server=servlet` is present - Skip HTTP/3 server initialization This ensures that the servlet container remains the sole owner of the server lifecycle and port binding. ### 2. Introduce a helper method for clarity A dedicated helper method is added to encapsulate the REST servlet mode check, improving readability and future maintainability. --- ## Why is this needed? Dubbo REST deployments running in servlet mode rely on the container to manage networking resources. Starting an additional Netty HTTP/3 server in this scenario can cause: - Port binding conflicts - Unclear server ownership - Unexpected startup failures Without this fix, REST servlet users enabling HTTP/3 may encounter runtime errors that are difficult to diagnose. This change aligns HTTP/3 behavior with Dubbo’s existing REST servlet architecture. --- ## Verifying this change - Code formatting verified with `mvn spotless:apply` - Module build passed locally: ```bash mvn -pl dubbo-rpc/dubbo-rpc-triple -am -DskipTests clean install ``` --- ## Checklist - [x] Make sure there is a GitHub issue field for the change. - [x] Write a pull request description that is detailed enough... - [ ] Write necessary unit-test... - [x] Make sure github actions can pass. -- 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]
