[Bug] serverSocketBacklog is settable but the accept backlog is hard-coded to 1024 (regression of #3529)

Đang mở
#11,396 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@iloveeyjafjalla đang làm issue này rồi.

Từ ngày 13/10/2026.

  • #11397 của @iloveeyjafjalla — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend, networking

Hướng nghiên cứu

The hard-coded ChannelOption.SO_BACKLOG value is in NettyRemotingServer#initServerBootstrap; compare it with the getter NettyServerConfig#getServerSocketBacklog(), which nothing in production reads. Done means the bootstrap option uses the configured backlog and NettyServerConfigTest still passes. A linked pull request (#11397) already targets this fix, so check it before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Before Creating the Bug Report
  • I found a bug, not just asking a question, which should be created in GitHub Discussions.
  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment

OS: any (remoting module; broker / nameserver / proxy accept backlog)

RocketMQ version

branch: develop
Git commit id: a7edeecfb (2026-10-13; the files are unchanged by that commit)

JDK Version

Compiler: Temurin 1.8.0_504 (target 1.8, same as CI)

Describe the Bug

serverSocketBacklog is settable (field, getter/setter and the rocketmq.remoting.socket.backlog system property), but the
accept backlog is a hard-coded literal, so the option silently does nothing.

NettyServerConfig:

private int serverSocketBacklog = NettySystemConfig.socketBacklog;
...
public int getServerSocketBacklog() { return serverSocketBacklog; }
public void setServerSocketBacklog(int serverSocketBacklog) { this.serverSocketBacklog = serverSocketBacklog; }

NettyRemotingServer#initServerBootstrap:

.option(ChannelOption.SO_BACKLOG, 1024)

getServerSocketBacklog() has no production reader anywhere in the repository — the only caller is
NettyServerConfigTest, which asserts that the setter stores the value. This is a regression of #3528/#3529 ("The value of
ChannelOption.SO_BACKLOG can not be hard-coded", 2021), which made the bootstrap read this option; the RIP-31
BrokerContainer refactor reverted that single line to the literal while keeping the field, the getter and the system
property.

Impact: an operator raising the backlog for a broker/nameserver/proxy that must absorb connection storms gets no change at
all — the listen queue stays at 1024, so bursts can be refused (clients see connection resets/timeouts) despite the tuned
configuration, and the value reported back by the config dump looks as if it were in effect.

Steps to Reproduce
  1. Set serverSocketBacklog=65535 in broker.conf (or -Drocketmq.remoting.socket.backlog=65535).
  2. Start the broker and inspect the server bootstrap: ChannelOption.SO_BACKLOG is 1024, not 65535.
  3. A connection burst larger than 1024 pending accepts is refused by the OS, exactly as with the default.
Expected behavior

The bootstrap uses the configured backlog, as it did before the RIP-31 refactor.

Actual behavior

The literal 1024 is used; the option is inert.

Additional context

Fix: pass this.nettyServerConfig.getServerSocketBacklog() to the bootstrap option, as #3529 did. NettyRemotingServer is
the only place a listening socket is created inside this module, so the single line restores the option for broker,
nameserver and the proxy's remoting server.

Ngôn ngữ chính
Java
Star
22.7k
Fork
12k
Merge trung bình
3 ngày 18 giờ
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/rocketmq

Tất cả issue của apache/rocketmq

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.