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 23:19:50 +0000 (18:19 -0500)
commit8af38ec0d7fd21f1c008c0d0b3b5442b14d1eae8
tree9cb23b65bc96585165b163641dce51f21492bfdd
parent0bc81e4555396942f9b91c17cf314f13e55ab0c7
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.025807 seconds and 4 git commands to generate.