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>
Thu, 15 Feb 2018 20:14:03 +0000 (15:14 -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 6ee3975792bb061b46035d6d7b5923af1ab6fd0f..8290b5faf05944fdae379a6b812f0a622020903e 100644 (file)
@@ -763,6 +763,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.026513 seconds and 4 git commands to generate.