Enable TCP/IP keepalive for all ZK client connections in all components started with bin/pulsar - #15908
Conversation
|
@lhotari:Thanks for your contribution. For this PR, do we need to update docs? |
|
@lhotari:Thanks for providing doc info! |
…ts (apache#15908) (cherry picked from commit ede3d19) (cherry picked from commit 77292ad)
|
It turns out that ZooKeeper TCP keepalive settings contain a major gap.
The part "Please note the distinction between it and tcpKeepAlive. It is applied for the client sockets while tcpKeepAlive is for the sockets used by quorum members. Currently this option is only available when default NIOServerCnxnFactory is used."
|
Motivation
This is a follow-up on #12982 which enabled TCP/IP keepalive for ZK server side.
This PR enables TCP/IP keepalive for all ZK client connections in all components
These never closed client sockets cause OS resource leak. Enabling this option terminates
these zombie sockets by idle check. ... Currently this option is only available
when default NIOServerCnxnFactory is used."
Modifications
add
-Dzookeeper.clientTcpKeepAlive=truetoOPTSinbin/pulsarscript so that the setting is passed to all components that are started usingbin/pulsarscript.