Skip to content

[Zookeeper] Enable TCP keepAlive flag on the sockets - #12982

Merged
merlimat merged 2 commits into
apache:masterfrom
lhotari:lh-enable-tcp-keepalive-by-default-for-zookeeper
Nov 29, 2021
Merged

[Zookeeper] Enable TCP keepAlive flag on the sockets#12982
merlimat merged 2 commits into
apache:masterfrom
lhotari:lh-enable-tcp-keepalive-by-default-for-zookeeper

Conversation

@lhotari

@lhotari lhotari commented Nov 25, 2021

Copy link
Copy Markdown
Member

Motivation

  • Enable TCP keepAlive flag on the sockets used by quorum members to perform elections
    • see https://issues.apache.org/jira/browse/ZOOKEEPER-1748 for details
      • "Setting this to true sets the TCP keepAlive flag on the sockets used by
        quorum members to perform elections. This will allow for connections between
        quorum members to remain up when there is network infrastructure that may
        otherwise break them.
        Some NATs and firewalls may terminate or lose state for long running
        or idle connections."
  • Enable TCP keepAlive flag on the sockets used for client connections
    • see https://issues.apache.org/jira/browse/ZOOKEEPER-3712 for details
      • "Some broken network infrastructure may lose the FIN packet that is sent from closing client.
        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

Specify -Dzookeeper.tcpKeepAlive=true -Dzookeeper.clientTcpKeepAlive=true
in default options for Zookeeper (ZK_OPTS in bin/pulsar)

Documentation

  • no-need-doc

- see https://issues.apache.org/jira/browse/ZOOKEEPER-1748 for details
  - "Setting this to true sets the TCP keepAlive flag on the sockets used by
     quorum members to perform elections. This will allow for connections between
     quorum members to remain up when there is network infrastructure that may
     otherwise break them.
     Some NATs and firewalls may terminate or lose state for long running
     or idle connections."
@lhotari lhotari added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages component/zookeeper labels Nov 25, 2021
@lhotari lhotari added this to the 2.10.0 milestone Nov 25, 2021
@lhotari lhotari self-assigned this Nov 25, 2021
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Nov 25, 2021
ZOOKEEPER-3712
"Some broken network infrastructure may lose the FIN packet that is sent from closing client.
 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."
@lhotari lhotari changed the title [Zookeeper] Enable TCP keepAlive flag on the sockets used by quorum members to perform elections [Zookeeper] Enable TCP keepAlive flag on the sockets Nov 25, 2021
@merlimat
merlimat merged commit 3f9ec3b into apache:master Nov 29, 2021
fxbing pushed a commit to fxbing/pulsar that referenced this pull request Dec 19, 2021
* Specify -Dzookeeper.tcpKeepAlive=true in default options for Zookeeper

- see https://issues.apache.org/jira/browse/ZOOKEEPER-1748 for details
  - "Setting this to true sets the TCP keepAlive flag on the sockets used by
     quorum members to perform elections. This will allow for connections between
     quorum members to remain up when there is network infrastructure that may
     otherwise break them.
     Some NATs and firewalls may terminate or lose state for long running
     or idle connections."

* Enable TCP keepalive for on Zookeeper server for client connections

ZOOKEEPER-3712
"Some broken network infrastructure may lose the FIN packet that is sent from closing client.
 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."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants