Signed-off-by: David Goulet <dgoulet@efficios.com>
error:
if (ret != LTTNG_OK) {
/*
- * On error, nullify the consumer sequence index so streams are not
- * associated with it once sent to the consumer.
+ * The consumer output for this session should not be used anymore
+ * since the relayd connection failed thus making any tracing or/and
+ * streaming not usable.
*/
- uatomic_set(&consumer->net_seq_index, -1);
+ consumer->enabled = 0;
}
return ret;
}
* Now get the channel from the consumer. This call wil populate the stream
* list of that channel and set the ust objects.
*/
- ret = ust_consumer_get_channel(socket, ua_chan);
- if (ret < 0) {
- goto error_destroy;
+ if (usess->consumer->enabled) {
+ ret = ust_consumer_get_channel(socket, ua_chan);
+ if (ret < 0) {
+ goto error_destroy;
+ }
}
rcu_read_unlock();
assert(socket->fd >= 0);
assert(registry);
+ if (!consumer->enabled) {
+ ret = -LTTNG_ERR_NO_CONSUMER;
+ DBG3("Consumer is disabled");
+ goto error;
+ }
+
pthread_mutex_lock(socket->lock);
ret = ask_channel_creation(ua_sess, ua_chan, consumer, socket, registry);