From: Mathieu Desnoyers Date: Thu, 3 Sep 2015 04:38:26 +0000 (-0400) Subject: Fix: relayd: don't check new metadata on get packet X-Git-Tag: v2.6.1~33 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ce9c79d3ba84852f943afb959e8136a0cfa43780;p=lttng-tools.git Fix: relayd: don't check new metadata on get packet We only care about this when we get the next index. There may be new metadata that appears between get next index and get packet, but it should not matter. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 7a8119f53..226ad679a 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -1477,8 +1477,6 @@ int viewer_get_packet(struct relay_connection *conn) struct lttng_viewer_get_packet get_packet_info; struct lttng_viewer_trace_packet reply; struct relay_viewer_stream *vstream = NULL; - struct ctf_trace *ctf_trace; - struct relay_viewer_stream *metadata_viewer_stream = NULL; DBG2("Relay get data packet"); @@ -1500,39 +1498,6 @@ int viewer_get_packet(struct relay_connection *conn) goto send_reply_nolock; } - ctf_trace = vstream->stream->trace; - - /* metadata_viewer_stream may be NULL. */ - metadata_viewer_stream = - ctf_trace_get_viewer_metadata_stream(ctf_trace); - - if (metadata_viewer_stream) { - bool get_packet_err = false; - - pthread_mutex_lock(&metadata_viewer_stream->stream->lock); - DBG("get packet metadata check: recv %" PRIu64 " sent %" PRIu64, - metadata_viewer_stream->stream->metadata_received, - metadata_viewer_stream->metadata_sent); - if (!metadata_viewer_stream->stream->metadata_received || - metadata_viewer_stream->stream->metadata_received > - metadata_viewer_stream->metadata_sent) { - /* - * We prevent the client from reading a data stream as - * long as there is metadata left to consume. This - * ensures that the client won't receive data of which - * it can't make sense. - */ - get_packet_err = true; - } - pthread_mutex_unlock(&metadata_viewer_stream->stream->lock); - viewer_stream_put(metadata_viewer_stream); - if (get_packet_err) { - reply.status = htobe32(LTTNG_VIEWER_GET_PACKET_ERR); - reply.flags |= LTTNG_VIEWER_FLAG_NEW_METADATA; - goto send_reply_nolock; - } - } - pthread_mutex_lock(&vstream->stream->lock); len = be32toh(get_packet_info.len);