lttng-relayd: use TCP keep-alive mechanism to detect dead-peer
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 22 Jan 2018 20:43:34 +0000 (15:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 1 Feb 2018 22:43:01 +0000 (17:43 -0500)
commitf056029cc220cf6f218a29d48d9720f6603302bf
tree54d3a1d2f49c0cea19b5e612202546d6a13bdd22
parent50121956c8e1876ae640538b342ceb737757169b
lttng-relayd: use TCP keep-alive mechanism to detect dead-peer

Allow relayd to clean-up objects related to a dead connection
for which the FIN packet was no emitted (Unexpected shutdown,
ethernet:blocking). Note that an idle peer is not considered dead given
that it respond to the keep-alive query after the idle time is elapsed.

By RFC 1122-4.2.3.6 implementation must default to no less than two
hours for the idle period. On linux the default value is indeed 2 hours.
This could be problematic if relayd should be aggressive regarding
dead-peers. Hence it is important to provide tuning knob regarding the
tcp keep-alive mechanism.

The following environments variable can be used to enable and fine-tune
it:
    LTTNG_RELAYD_TCP_KEEP_ALIVE_ENABLE
        Set to 1 to enable the use of tcp keep-alive allowing the detection
        of dead peers.

    LTTNG_RELAYD_TCP_KEEP_ALIVE_TIME
        See tcp(7) tcp_keepalive_time or tcp_keepalive_interval on
        Solaris 11.
        A value of -1 lets the operating system manage this parameter
        (default).

    LTTNG_RELAYD_TCP_KEEP_ALIVE_PROBES
        See tcp(7) tcp_keepalive_probes.
        A value of -1 lets the operating system manage this
        parameter (default).
        No effect on Solaris.

    LTTNG_RELAYD_TCP_KEEP_ALIVE_INTVL`::
        See tcp(7) tcp_keepalive_intvl.
        A value of -1 lets the operating system manage
        his parameter (default).

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/Makefile.am
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/tcp_keep_alive.c [new file with mode: 0644]
src/bin/lttng-relayd/tcp_keep_alive.h [new file with mode: 0644]
src/common/defaults.h
This page took 0.034013 seconds and 4 git commands to generate.