X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer.c;h=260779ae6d1ace6d9a186c40c2202a654c85dbea;hp=f69f0081a9cd77a38798c3dd745cd842cd4f4329;hb=7608208897f23f1419759e786175247a39703a79;hpb=2e818a6aca8708674e601d3c2c4ff6f6e87c5fca diff --git a/src/common/consumer.c b/src/common/consumer.c index f69f0081a..260779ae6 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -1874,6 +1874,8 @@ static int consumer_add_metadata_stream(struct lttng_consumer_stream *stream, { int ret = 0; struct consumer_relayd_sock_pair *relayd; + struct lttng_ht_iter iter; + struct lttng_ht_node_ulong *node; assert(stream); assert(ht); @@ -1889,6 +1891,15 @@ static int consumer_add_metadata_stream(struct lttng_consumer_stream *stream, */ rcu_read_lock(); + + /* + * Lookup the stream just to make sure it does not exist in our internal + * state. This should NEVER happen. + */ + lttng_ht_lookup(ht, (void *)((unsigned long) stream->wait_fd), &iter); + node = lttng_ht_iter_get_node_ulong(&iter); + assert(!node); + /* Find relayd and, if one is found, increment refcount. */ relayd = consumer_find_relayd(stream->net_seq_idx); if (relayd != NULL) { @@ -1909,9 +1920,6 @@ static int consumer_add_metadata_stream(struct lttng_consumer_stream *stream, uatomic_dec(&stream->chan->nb_init_streams); } - /* Steal stream identifier to avoid having streams with the same key */ - consumer_steal_stream_key(stream->key, ht); - lttng_ht_add_unique_ulong(ht, &stream->node); /*