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)
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>

No differences found
This page took 0.026633 seconds and 5 git commands to generate.