Assert that the consumer socket lock is taken during communication
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Feb 2018 19:59:35 +0000 (14:59 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Feb 2018 22:54:29 +0000 (17:54 -0500)
The consumer_data lock must be acquired during any communication
between the session and consumer daemons.

Stress tests have shown a number of deadlocks that have been
traced down to this type of errors.

Individual fixes follow this commit.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c

index 33ccfe2248c91bd50fa0a4c94489790404e24264..bd9048bf517d54b9ccb8148310d82b5ee21bc9b1 100644 (file)
@@ -762,6 +762,7 @@ int consumer_send_msg(struct consumer_socket *sock,
 
        assert(msg);
        assert(sock);
+       assert(pthread_mutex_trylock(sock->lock) == EBUSY);
 
        ret = consumer_socket_send(sock, msg, sizeof(struct lttcomm_consumer_msg));
        if (ret < 0) {
This page took 0.025461 seconds and 4 git commands to generate.