Fix: set relayd sock sent flag per consumer socket
authorDavid Goulet <dgoulet@efficios.com>
Mon, 18 Feb 2013 19:08:19 +0000 (14:08 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 18 Feb 2013 19:08:19 +0000 (14:08 -0500)
The session daemon usually handles two consumers, one for 32 bits
applications and one for 64 bits.

When sending relayd information to the consumer, we must sent it to
every existing consumer in case a session contains 32 and 64 bits
applications. So, the sent flag is moved from the consumer output object
to be per consumer socket.

This bug was seen and diagnosed during the 2.2 development phase and is
fixed in master branch in the following commit.

commit (master): ffe600149a7608221985751e1bf293234bf2545c

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/consumer.h

index 8bffdc406751a37b8a83369e0764bbab193d3cc6..0f94a5f36b695b0bebc2e4b58cbf89a060a2f322 100644 (file)
@@ -571,9 +571,9 @@ static int send_consumer_relayd_socket(int domain, struct ltt_session *session,
 
        /* Flag that the corresponding socket was sent. */
        if (relayd_uri->stype == LTTNG_STREAM_CONTROL) {
-               consumer->dst.net.control_sock_sent = 1;
+               consumer_sock->control_sock_sent = 1;
        } else if (relayd_uri->stype == LTTNG_STREAM_DATA) {
-               consumer->dst.net.data_sock_sent = 1;
+               consumer_sock->data_sock_sent = 1;
        }
 
        ret = LTTNG_OK;
@@ -607,7 +607,7 @@ static int send_consumer_relayd_sockets(int domain,
        assert(consumer);
 
        /* Sending control relayd socket. */
-       if (!consumer->dst.net.control_sock_sent) {
+       if (!sock->control_sock_sent) {
                ret = send_consumer_relayd_socket(domain, session,
                                &consumer->dst.net.control, consumer, sock);
                if (ret != LTTNG_OK) {
@@ -616,7 +616,7 @@ static int send_consumer_relayd_sockets(int domain,
        }
 
        /* Sending data relayd socket. */
-       if (!consumer->dst.net.data_sock_sent) {
+       if (!sock->data_sock_sent) {
                ret = send_consumer_relayd_socket(domain, session,
                                &consumer->dst.net.data, consumer, sock);
                if (ret != LTTNG_OK) {
@@ -1662,15 +1662,8 @@ int cmd_set_consumer_uri(int domain, struct ltt_session *session,
                        goto error;
                }
 
-               /*
-                * Don't send relayd socket if URI is NOT remote or if the relayd
-                * socket for the session was already sent.
-                */
-               if (uris[i].dtype == LTTNG_DST_PATH ||
-                               (uris[i].stype == LTTNG_STREAM_CONTROL &&
-                               consumer->dst.net.control_sock_sent) ||
-                               (uris[i].stype == LTTNG_STREAM_DATA &&
-                               consumer->dst.net.data_sock_sent)) {
+               /* Don't send relayd socket if URI is NOT remote */
+               if (uris[i].dtype == LTTNG_DST_PATH) {
                        continue;
                }
 
index 11c98773ee363de996ff03d6d158695c4f6e67c7..b08cb546a1ae2a702a8c90cc0b8d6eecb36e0a6c 100644 (file)
@@ -45,6 +45,13 @@ struct consumer_socket {
         */
        unsigned int registered;
 
+       /*
+        * Flag if relayd network sockets were sent to the consumer through this
+        * socket.
+        */
+       unsigned int control_sock_sent;
+       unsigned int data_sock_sent;
+
        struct lttng_ht_node_ulong node;
 };
 
@@ -107,10 +114,6 @@ struct consumer_net {
 
        /* Data path for network streaming. */
        struct lttng_uri data;
-
-       /* Flag if network sockets were sent to the consumer. */
-       unsigned int control_sock_sent;
-       unsigned int data_sock_sent;
 };
 
 /*
This page took 0.028611 seconds and 4 git commands to generate.