qianye1001 opened a new issue, #11151: URL: https://github.com/apache/rocketmq/issues/11151
### Runtime platform environment macOS aarch64, JDK 11. ### RocketMQ version `develop`, commit `d38f81e787`. ### Describe the Bug Sub-servers created by `NettyRemotingServer.newRemotingServer(port)` do not honor the parent's graceful-shutdown configuration. `SubRemotingServer.shutdown()` sets its shutdown flag and immediately closes its listening channel. During the configured grace period, new connections therefore fail instead of receiving `GO_AWAY` responses for supported client versions. Calling only the parent's `shutdown()` has another gap: it marks only the parent as shutting down, so sub-servers can continue processing requests until the shared event loops shut down. Concurrent shutdown calls also need coordination: a repeated call must not bypass the first call's grace period and close the listener or shared resources early. ### Steps to Reproduce 1. Start a `NettyRemotingServer` with `enableShutdownGracefully=true` and `shutdownWaitTimeSeconds=5`. 2. Create and start sub-servers on other ports, and register a request processor on each server. 3. Establish a connection and send a request using a protocol version newer than `V5_3_1`. 4. Call a sub-server's `shutdown()` on another thread. During the grace period, send another request over the existing connection and try a fresh connection to that port. 5. Separately, call only the parent server's `shutdown()` and send requests to the sub-server ports during the grace period. ### What Did You Expect to See? A standalone sub-server shutdown keeps its listener available during the configured grace period and uses the existing `GO_AWAY` handling, without shutting down other ports or shared resources. A parent shutdown marks all its sub-servers as draining, waits one shared grace period, and then closes listeners and releases shared resources. Main/sub shutdowns and repeated calls may run concurrently; grace periods must not be serialized or cut short. ### What Did You See Instead? The standalone sub-server closes its listener immediately. Parent-only shutdown leaves sub-servers outside the draining state. A regression test on the unmodified commit times out waiting for a child to enter that state after parent shutdown starts. -- 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]
