wolfstudy opened a new pull request, #4762: URL: https://github.com/apache/bookkeeper/pull/4762
## Motivation In PR #4683, we introduced support for configuring TCP keep-alive parameters (TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT) on the Bookie client side (PerChannelBookieClient). This allowed users to fine-tune keep-alive behavior per connection instead of relying solely on the kernel-level defaults defined in /proc/sys/net/ipv4/tcp_keepalive_*. However, as discussed in apache/pulsar#25580, a one-sided configuration is not enough. TCP keep-alive is a per-socket setting that works independently on each end of a connection. If only the client enables custom keep-alive parameters while the server still uses the OS-level defaults, operators are still forced to tune the kernel parameters of the host on which the Bookie runs in order to achieve a consistent end-to-end keep-alive behavior. This defeats the purpose of having fine-grained, application-level control and makes it cumbersome to deploy Bookies in environments where modifying OS-wide TCP settings is not permitted (e.g., shared or managed hosts). To close this gap, we need to provide the same configurability on the Bookie server side (BookieNettyServer), so that a complete, symmetric TCP keep-alive configuration can be achieved from BookKeeper itself, without requiring any changes to the underlying operating system. ## Changes - ServerConfiguration: added serverTcpKeepIdle / serverTcpKeepIntvl / serverTcpKeepCnt, all defaulting to -1 (meaning "use OS default"). - BookieNettyServer: applies the new options via EpollChannelOption.TCP_KEEPIDLE / TCP_KEEPINTVL / TCP_KEEPCNT when the event loop is EpollEventLoopGroup, and only when the value is > 0. For Nio / IoUring / Default event loops, behavior falls back to the original SO_KEEPALIVE — fully backward compatible. ## Backward Compatibility All new options default to -1 and Epoll-specific channel options are only applied on EpollEventLoopGroup. Existing deployments see no behavior change after upgrading. ## References - Client-side support: apache/bookkeeper#4683 - Motivation for symmetric server+client config: apache/pulsar#25580 -- 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]
