X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Flive.c;h=5d3449d4f451f49aaf64a6f3506a4b93c1affc3c;hb=16d6d62d27a935394c7ea7970d0c9815ba297ce5;hp=888ec2d4f616d10f5d4720bfbea05158361d48bf;hpb=39f0f159036ec4015049ac859ef89f30823aeb2a;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 888ec2d4f..5d3449d4f 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -1629,7 +1629,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);