Allow get_next_notification to return when interrupted
Applications (and scripts) which consume a given set of notifications
indefinitely may fail to exit if a SIGTERM handler is registered.
lttng_notification_channel_get_next_notification() blocks indefinitely
on recvmsg() until a new notification is available. The wrapper that
is used to do so automatically restarts the recvmsg() if it is
interrupted, thus not allowing clients a change to cleanly exit.
This change causes the notification channel to wait for a message to
be available using select() before starting the actual reception of
the data and return LTTNG_NOTIFICATION_CHANNEL_STATUS_INTERRUTPED if a
signal occurs during the wait.
If data is available, it is assumed that the message is well-formed
and can promptly be received in its entirety. The goal of this change
is to give a monitoring application a chance to leave the
get_next_notification() function and check if it should exit.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.026491 seconds and 4 git commands to generate.