Use non-blocking recvmsg() for data/ctrl connections of lttng-relayd
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 21 Feb 2018 05:57:26 +0000 (00:57 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 27 Apr 2018 15:42:04 +0000 (11:42 -0400)
commit5312a3edd938117cb5670de711f237e7b6f2e68c
treeea6af6fbee6dd50546468702db445c064b2a4e06
parent2288467f63826a06d25ac361fa04ea92ec7ddfa3
Use non-blocking recvmsg() for data/ctrl connections of lttng-relayd

The relay daemon's use of blocking network I/O can cause severe
performance degradation when interacting with unresponsive peers.

This patch changes the recvmsg() calls to use the MSG_DONTWAIT flag
which makes the call non-blocking. The connection classes are modified
to handle the partial reception of buffers.

The sendmsg() calls are still blocking, but this is assumed to
represent a fairly minimal risk of actually blocking given that
the control protocol's replies consist of 4-byte status codes.

A similar approach could be used to make the live connections
non-blocking as that side may also suffer from the same resiliancy
problems. So far, no users have reported this problem so it is
not prioritised.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
16 files changed:
src/bin/lttng-relayd/Makefile.am
src/bin/lttng-relayd/cmd-2-1.c
src/bin/lttng-relayd/cmd-2-1.h
src/bin/lttng-relayd/cmd-2-2.c
src/bin/lttng-relayd/cmd-2-2.h
src/bin/lttng-relayd/cmd-2-4.c
src/bin/lttng-relayd/cmd-2-4.h
src/bin/lttng-relayd/cmd-generic.c [deleted file]
src/bin/lttng-relayd/cmd-generic.h [deleted file]
src/bin/lttng-relayd/cmd.h
src/bin/lttng-relayd/connection.c
src/bin/lttng-relayd/connection.h
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/stream.c
src/common/sessiond-comm/inet.c
src/common/sessiond-comm/inet6.c
This page took 0.035847 seconds and 4 git commands to generate.