Fix: relayd reply with error if cannot find metadata
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Aug 2015 11:43:16 +0000 (07:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 24 Sep 2015 02:22:12 +0000 (22:22 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c

index 51457400bbff43c00b738503bcd223db33325449..1ae1ae98be675e2457828c9753b8ffbd97f51258 100644 (file)
@@ -1628,7 +1628,15 @@ int viewer_get_metadata(struct relay_connection *conn)
 
        vstream = viewer_stream_get_by_id(be64toh(request.stream_id));
        if (!vstream) {
-               reply.status = htobe32(LTTNG_VIEWER_NO_NEW_METADATA);
+               /*
+                * The metadata stream can be closed by a CLOSE command
+                * just before we attach. It can also be closed by
+                * per-pid tracing during tracing. Therefore, it is
+                * possible that we cannot find this viewer stream.
+                * Reply back to the client with an error if we cannot
+                * find it.
+                */
+               reply.status = htobe32(LTTNG_VIEWER_METADATA_ERR);
                goto send_reply;
        }
        pthread_mutex_lock(&vstream->stream->lock);
This page took 0.02692 seconds and 4 git commands to generate.