iloveeyjafjalla opened a new pull request, #11397:
URL: https://github.com/apache/rocketmq/pull/11397

   ### Which Issue(s) This PR Fixes
   
   - Fixes #11396
   
   ### Brief Description
   
   `serverSocketBacklog` is a settable option (field, getter/setter, and the 
`rocketmq.remoting.socket.backlog` system property)
   whose getter has no production reader, because 
`NettyRemotingServer#initServerBootstrap` passes a literal to Netty:
   
   ```java
   .option(ChannelOption.SO_BACKLOG, 1024)
   ```
   
   This is a regression of #3528/#3529 ("The value of ChannelOption.SO_BACKLOG 
can not be hard-coded"), which made the bootstrap
   read the option — the RIP-31 BrokerContainer refactor reverted that line 
while keeping the field, its accessors and the
   system property. Consequently a broker/nameserver whose operator raises the 
backlog for connection bursts keeps accepting
   with a 1024-deep listen queue, and the value echoed by the configuration 
looks as if it were applied.
   
   The change passes `nettyServerConfig.getServerSocketBacklog()` to the 
bootstrap, restoring the behaviour of #3529. It is the
   only listening socket created inside the module, so one line covers broker, 
nameserver and the proxy's remoting server.
   
   ### How Did You Test This Change?
   
   Extended `NettyRemotingServerTest` with 
`serverSocketBacklogIsAppliedToTheBootstrap`: it configures 65535 on the server
   config, builds a real `NettyRemotingServer`, runs `initServerBootstrap` on a 
fresh `ServerBootstrap` and asserts the
   `SO_BACKLOG` option carries the configured value.
   
   Results on Temurin JDK 8 (same JDK as CI), base `a7edeecfb` plus this patch:
   
   - before the fix: `java.lang.AssertionError: expected:<65535> but was:<1024>`
   - after the fix: `NettyRemotingServerTest`, `NettyRemotingClientTest`, 
`NettyServerConfigTest`, `NettyClientConfigTest` —
     20 tests, 0 failures
   - `mvn -B -ntp -pl remoting package` with checkstyle + spotbugs enabled: 
`BUILD SUCCESS`, spotbugs `BugInstance size is 0`
   
   This change was prepared with AI assistance (analysis, patch and test 
drafting); the diff and every result above were
   reproduced locally by running the module's tests against the base commit and 
the patched tree.
   


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

Reply via email to