From ff743f573b3020fce183d8bd57aca3f374900b10 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 3 Sep 2015 00:38:26 -0400 Subject: [PATCH] Fix: relayd: don't check new metadata on get packet MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-relayd/live.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 57ff9197a..2972a500f 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -1478,8 +1478,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"); @@ -1501,39 +1499,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); -- 2.34.1