This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/2.6.x by this push:
     new 37c3460  netty3 backlog (#7471)
37c3460 is described below

commit 37c3460bf784218be88820cdd5e0bdaedf33bbf3
Author: xmh51 <[email protected]>
AuthorDate: Mon May 17 01:23:10 2021 +0800

    netty3 backlog (#7471)
    
    Co-authored-by: xmh <[email protected]>
    Co-authored-by: Albumen Kevin <[email protected]>
---
 dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java    | 4 ++++
 .../java/com/alibaba/dubbo/remoting/transport/netty/NettyServer.java  | 1 +
 2 files changed, 5 insertions(+)

diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java 
b/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java
index 0bb2b2e..9365a4d 100644
--- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java
+++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java
@@ -647,6 +647,10 @@ public class Constants {
 
     public static final String TELNET = "telnet";
 
+    public static final String BACKLOG_KEY = "backlog";
+
+    public static final int DEFAULT_BACKLOG = 1024;
+
     public static final String DOT_REGEX = "\\.";
 
     public static final String UNDERLINE_SEPARATOR = "_";
diff --git 
a/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyServer.java
 
b/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyServer.java
index 5feddbc..46ea8db 100644
--- 
a/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyServer.java
+++ 
b/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyServer.java
@@ -75,6 +75,7 @@ public class NettyServer extends AbstractServer implements 
Server {
         // https://issues.jboss.org/browse/NETTY-379
         // final Timer timer = new HashedWheelTimer(new 
NamedThreadFactory("NettyIdleTimer", true));
         bootstrap.setOption("child.tcpNoDelay", true);
+        bootstrap.setOption("backlog", 
getUrl().getPositiveParameter(Constants.BACKLOG_KEY, 
Constants.DEFAULT_BACKLOG));
         bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
             @Override
             public ChannelPipeline getPipeline() {

Reply via email to