lhotari commented on code in PR #4762:
URL: https://github.com/apache/bookkeeper/pull/4762#discussion_r3152851325


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java:
##########


Review Comment:
   these lines in the current code don't make sense for internal VM transport.



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java:
##########
@@ -391,6 +417,29 @@ protected void initChannel(SocketChannel ch) throws 
Exception {
             jvmBootstrap.option(ChannelOption.WRITE_BUFFER_WATER_MARK, new 
WriteBufferWaterMark(
                     conf.getServerWriteBufferLowWaterMark(), 
conf.getServerWriteBufferHighWaterMark()));
 
+            // Set TCP keepalive parameters if configured
+            if (EventLoopUtil.isIoUringGroup(jvmEventLoopGroup)) {
+                if (conf.getServerTcpKeepIdle() > 0) {
+                    jvmBootstrap.option(IoUringChannelOption.TCP_KEEPIDLE, 
conf.getServerTcpKeepIdle());
+                }
+                if (conf.getServerTcpKeepIntvl() > 0) {
+                    jvmBootstrap.option(IoUringChannelOption.TCP_KEEPINTVL, 
conf.getServerTcpKeepIntvl());
+                }
+                if (conf.getServerTcpKeepCnt() > 0) {
+                    jvmBootstrap.option(IoUringChannelOption.TCP_KEEPCNT, 
conf.getServerTcpKeepCnt());
+                }
+            } else if (jvmEventLoopGroup instanceof EpollEventLoopGroup) {
+                if (conf.getServerTcpKeepIdle() > 0) {
+                    jvmBootstrap.option(EpollChannelOption.TCP_KEEPIDLE, 
conf.getServerTcpKeepIdle());
+                }
+                if (conf.getServerTcpKeepIntvl() > 0) {
+                    jvmBootstrap.option(EpollChannelOption.TCP_KEEPINTVL, 
conf.getServerTcpKeepIntvl());
+                }
+                if (conf.getServerTcpKeepCnt() > 0) {
+                    jvmBootstrap.option(EpollChannelOption.TCP_KEEPCNT, 
conf.getServerTcpKeepCnt());
+                }
+            }

Review Comment:
   `conf.isEnableLocalTransport` enables internal VM transport 
(https://issues.apache.org/jira/browse/BOOKKEEPER-896) where there's no 
network. The current code to use a different channel than 
[LocalServerChannel](https://netty.io/4.1/api/io/netty/channel/local/LocalServerChannel.html)
 doesn't make any sense and no network related settings like 
ChannelOption.TCP_NODELAY. ChannelOption.SO_KEEPALIVE or 
ChannelOption.SO_LINGER shouldn't be set for jvmBootStrap.



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java:
##########


Review Comment:
   These options don't make sense for the internal VM transport.



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