From: Mathieu Desnoyers Date: Wed, 14 Nov 2018 21:46:05 +0000 (-0500) Subject: Fix: sessiond: snapshot: handle consumer return codes X-Git-Tag: v2.11.0-rc2~171 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d5f19c28c2a1dc801567d096a49f28e8fd562c6e;p=lttng-tools.git Fix: sessiond: snapshot: handle consumer return codes Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/consumer.c b/src/bin/lttng-sessiond/consumer.c index b6c9d3055..a179eeffd 100644 --- a/src/bin/lttng-sessiond/consumer.c +++ b/src/bin/lttng-sessiond/consumer.c @@ -1505,6 +1505,14 @@ int consumer_snapshot_channel(struct consumer_socket *socket, uint64_t key, ret = consumer_send_msg(socket, &msg); pthread_mutex_unlock(socket->lock); if (ret < 0) { + switch (-ret) { + case LTTCOMM_CONSUMERD_CHAN_NOT_FOUND: + ret = -LTTNG_ERR_CHAN_NOT_FOUND; + break; + default: + ret = -LTTNG_ERR_SNAPSHOT_FAIL; + break; + } goto error; } diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 2c1b845ad..0e1907d8e 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -6066,15 +6066,17 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, nb_packets_per_stream, trace_archive_id); if (ret < 0) { + if (ret == -LTTNG_ERR_CHAN_NOT_FOUND) { + continue; + } goto error; } } registry = get_session_registry(ua_sess); if (!registry) { - DBG("Application session is being torn down. Abort snapshot record."); - ret = -1; - goto error; + DBG("Application session is being torn down. Skip application."); + continue; } ret = consumer_snapshot_channel(socket, registry->metadata_key, output, @@ -6082,6 +6084,9 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, pathname, wait, 0, trace_archive_id); if (ret < 0) { + if (ret == -LTTNG_ERR_CHAN_NOT_FOUND) { + continue; + } goto error; } }