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

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


The following commit(s) were added to refs/heads/master by this push:
     new a5195726ccb Optimize so-reuseaddr in netty to solve the problem of 
port occupied (#17006) (#17008)
a5195726ccb is described below

commit a5195726ccbbb16eb54adefdffce24c245fdf9b2
Author: galaxy <[email protected]>
AuthorDate: Fri Apr 22 20:16:26 2022 +0800

    Optimize so-reuseaddr in netty to solve the problem of port occupied 
(#17006) (#17008)
---
 .../org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java
 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java
index c3e24645287..86b580a1bac 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-core/src/main/java/org/apache/shardingsphere/proxy/frontend/ShardingSphereProxy.java
@@ -98,6 +98,7 @@ public final class ShardingSphereProxy {
                 .channel(Epoll.isAvailable() ? EpollServerSocketChannel.class 
: NioServerSocketChannel.class)
                 .option(ChannelOption.WRITE_BUFFER_WATER_MARK, new 
WriteBufferWaterMark(8 * 1024 * 1024, 16 * 1024 * 1024))
                 .option(ChannelOption.ALLOCATOR, 
PooledByteBufAllocator.DEFAULT)
+                .option(ChannelOption.SO_REUSEADDR, true)
                 .childOption(ChannelOption.ALLOCATOR, 
PooledByteBufAllocator.DEFAULT)
                 .childOption(ChannelOption.TCP_NODELAY, true)
                 .handler(new LoggingHandler(LogLevel.INFO))

Reply via email to