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

hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 5aebde097c [type:refactor] delete SO_SNDBUF & SO_RCVBUF (#5502)
5aebde097c is described below

commit 5aebde097cb25902e2ac56cbabb0d0f778c4ccda
Author: Sinsy <[email protected]>
AuthorDate: Wed Mar 20 10:50:28 2024 +0800

    [type:refactor] delete SO_SNDBUF & SO_RCVBUF (#5502)
    
    * delete SO_SNDBUF SO_RCVBUF
    
    * fix ci
    
    * fix ci
    
    ---------
    
    Co-authored-by: moremind <[email protected]>
---
 shenyu-bootstrap/src/main/resources/application.yml  |  3 ---
 .../shenyu/common/config/NettyChannelProperties.java | 20 --------------------
 .../shenyu/common/config/NettyHttpProperties.java    | 20 --------------------
 .../netty/ShenyuNettyWebServerConfiguration.java     |  3 ---
 .../netty/ShenyuNettyWebServerConfigurationTest.java |  5 -----
 5 files changed, 51 deletions(-)

diff --git a/shenyu-bootstrap/src/main/resources/application.yml 
b/shenyu-bootstrap/src/main/resources/application.yml
index 7efa2bb474..08ff3a1b65 100644
--- a/shenyu-bootstrap/src/main/resources/application.yml
+++ b/shenyu-bootstrap/src/main/resources/application.yml
@@ -110,7 +110,6 @@ shenyu:
       workerCount: 8
       accessLog: false
       serverSocketChannel:
-        soRcvBuf: 87380
         soBackLog: 128
         soReuseAddr: false
         connectTimeoutMillis: 10000
@@ -126,8 +125,6 @@ shenyu:
         soReuseAddr: false
         soLinger: -1
         tcpNoDelay: true
-        soRcvBuf: 87380
-        soSndBuf: 16384
         ipTos: 0
         allowHalfClosure: false
         connectTimeoutMillis: 10000
diff --git 
a/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java
 
b/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java
index 0a18fbb92d..e3dfd7cd4d 100644
--- 
a/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java
+++ 
b/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyChannelProperties.java
@@ -51,8 +51,6 @@ public class NettyChannelProperties {
 
     private Boolean soReuseAddr = false;
 
-    private Integer soRcvBuf = 87380;
-
     /**
      * message estimator.
      */
@@ -198,24 +196,6 @@ public class NettyChannelProperties {
         this.soReuseAddr = soReuseAddr;
     }
 
-    /**
-     * get soRcvBuf.
-     *
-     * @return soRcvBuf
-     */
-    public Integer getSoRcvBuf() {
-        return soRcvBuf;
-    }
-
-    /**
-     * set soRcvBuf.
-     *
-     * @param soRcvBuf SO_RCVBUF
-     */
-    public void setSoRcvBuf(final Integer soRcvBuf) {
-        this.soRcvBuf = soRcvBuf;
-    }
-
     /**
      * message size estimator.
      *
diff --git 
a/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java
 
b/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java
index 1c14d796db..82c89495fa 100644
--- 
a/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java
+++ 
b/shenyu-common/src/main/java/org/apache/shenyu/common/config/NettyHttpProperties.java
@@ -198,8 +198,6 @@ public class NettyHttpProperties {
 
         private Boolean tcpNoDelay = true;
 
-        private Integer soSndBuf = 16384;
-
         private Integer ipTos = 0;
 
         private Boolean allowHalfClosure = false;
@@ -258,24 +256,6 @@ public class NettyHttpProperties {
             this.tcpNoDelay = tcpNoDelay;
         }
 
-        /**
-         * get soSndBuf.
-         *
-         * @return soSndBuf
-         */
-        public Integer getSoSndBuf() {
-            return soSndBuf;
-        }
-
-        /**
-         * set soSndBuf.
-         *
-         * @param soSndBuf SO_SNDBUF
-         */
-        public void setSoSndBuf(final Integer soSndBuf) {
-            this.soSndBuf = soSndBuf;
-        }
-
         /**
          * get ipTos.
          * @return ipTos
diff --git 
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/main/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfiguration.java
 
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/main/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfiguration.java
index 8d2cb692ce..a6b17cfbae 100644
--- 
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/main/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfiguration.java
+++ 
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/main/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfiguration.java
@@ -156,7 +156,6 @@ public class ShenyuNettyWebServerConfiguration {
                     // server socket channel parameters
                     .option(ChannelOption.SO_BACKLOG, 
nettyHttpProperties.getServerSocketChannel().getSoBacklog())
                     .option(ChannelOption.SO_REUSEADDR, 
nettyHttpProperties.getServerSocketChannel().isSoReuseAddr())
-                    .option(ChannelOption.SO_RCVBUF, 
nettyHttpProperties.getServerSocketChannel().getSoRcvBuf())
                     // common parameters
                     .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
nettyHttpProperties.getServerSocketChannel().getConnectTimeoutMillis())
                     .option(ChannelOption.WRITE_BUFFER_WATER_MARK, new 
WriteBufferWaterMark(nettyHttpProperties.getServerSocketChannel().getWriteBufferLowWaterMark(),
@@ -171,10 +170,8 @@ public class ShenyuNettyWebServerConfiguration {
                     .childOption(ChannelOption.SO_KEEPALIVE, 
nettyHttpProperties.getSocketChannel().isSoKeepAlive())
                     .childOption(ChannelOption.SO_LINGER, 
nettyHttpProperties.getSocketChannel().getSoLinger())
                     .childOption(ChannelOption.TCP_NODELAY, 
nettyHttpProperties.getSocketChannel().isTcpNoDelay())
-                    .childOption(ChannelOption.SO_SNDBUF, 
nettyHttpProperties.getSocketChannel().getSoSndBuf())
                     .childOption(ChannelOption.IP_TOS, 
nettyHttpProperties.getSocketChannel().getIpTos())
                     .childOption(ChannelOption.ALLOW_HALF_CLOSURE, 
nettyHttpProperties.getSocketChannel().isAllowHalfClosure())
-                    .childOption(ChannelOption.SO_RCVBUF, 
nettyHttpProperties.getSocketChannel().getSoRcvBuf())
                     .childOption(ChannelOption.SO_REUSEADDR, 
nettyHttpProperties.getSocketChannel().isSoReuseAddr())
                     // common parameters
                     .childOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
nettyHttpProperties.getSocketChannel().getConnectTimeoutMillis())
diff --git 
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/test/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfigurationTest.java
 
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/test/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfigurationTest.java
index 634d4a1db7..39fd875748 100644
--- 
a/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/test/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfigurationTest.java
+++ 
b/shenyu-spring-boot-starter/shenyu-spring-boot-starter-gateway/src/test/java/org/apache/shenyu/springboot/starter/netty/ShenyuNettyWebServerConfigurationTest.java
@@ -57,7 +57,6 @@ public class ShenyuNettyWebServerConfigurationTest {
                 "shenyu.netty.http.serverSocketChannel.soBacklog=64",
                 
"shenyu.netty.http.serverSocketChannel.connectTimeoutMillis=65536",
                 
"shenyu.netty.http.serverSocketChannel.writeBufferLowWaterMark=65536",
-                "shenyu.netty.http.serverSocketChannel.soRcvBuf=65536",
                 "shenyu.netty.http.socketChannel.soSndBuf=128",
                 "shenyu.netty.http.socketChannel.ipTos=64",
                 "shenyu.netty.http.socketChannel.soKeepAlive=true",
@@ -69,7 +68,6 @@ public class ShenyuNettyWebServerConfigurationTest {
                 "shenyu.netty.http.socketChannel.writeSpinCount=8",
                 "shenyu.netty.http.socketChannel.autoRead=false",
                 "shenyu.netty.http.socketChannel.soReuseAddr=true",
-                "shenyu.netty.http.socketChannel.soRcvBuf=65536",
                 "shenyu.netty.http.socketChannel.messageSizeEstimator=8",
                 
"shenyu.netty.http.socketChannel.singleEventExecutorPerGroup=false"
             )
@@ -84,9 +82,7 @@ public class ShenyuNettyWebServerConfigurationTest {
                 assertThat(properties.getServerSocketChannel().getSoBacklog(), 
is(64));
                 
assertThat(properties.getServerSocketChannel().getConnectTimeoutMillis(), 
is(65536));
                 
assertThat(properties.getServerSocketChannel().getWriteBufferLowWaterMark(), 
is(65536));
-                assertThat(properties.getServerSocketChannel().getSoRcvBuf(), 
is(65536));
                 assertNotNull(properties.getSocketChannel());
-                assertThat(properties.getSocketChannel().getSoSndBuf(), 
is(128));
                 assertThat(properties.getSocketChannel().getIpTos(), is(64));
                 assertThat(properties.getSocketChannel().isSoKeepAlive(), 
is(true));
                 assertThat(properties.getSocketChannel().isAllowHalfClosure(), 
is(true));
@@ -97,7 +93,6 @@ public class ShenyuNettyWebServerConfigurationTest {
                 assertThat(properties.getSocketChannel().getWriteSpinCount(), 
is(8));
                 assertThat(properties.getSocketChannel().isAutoRead(), 
is(false));
                 assertThat(properties.getSocketChannel().isSoReuseAddr(), 
is(true));
-                assertThat(properties.getSocketChannel().getSoRcvBuf(), 
is(65536));
                 
assertThat(properties.getSocketChannel().getMessageSizeEstimator(), is(8));
                 
assertThat(properties.getSocketChannel().getSingleEventExecutorPerGroup(), 
is(false));
             });

Reply via email to