From e38d96f9a1077b329d2239aabc50f57fcd3a73e4 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 14 Nov 2018 17:46:26 -0500 Subject: [PATCH] Fix: channel errors on local stress-tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On local stress-tests with per-pid buffers, error paths triggered when trying to create a channel on an application already going away end up tiggering the channel destruction with "-1" socket parameter. This function attempts to send a notification of channel destruction (erroneously) and attempts to sum counters into a channel object which may not have been populated yet. Therefore, don't perform those side-effects when invoked from error path caused by channel creation error. Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/ust-app.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index ad6bc09f7..f97d869e6 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -487,9 +487,11 @@ void delete_ust_app_channel(int sock, struct ust_app_channel *ua_chan, registry = get_session_registry(ua_chan->session); if (registry) { ust_registry_channel_del_free(registry, ua_chan->key, - true); + sock >= 0); + } + if (sock >= 0) { + save_per_pid_lost_discarded_counters(ua_chan); } - save_per_pid_lost_discarded_counters(ua_chan); } if (ua_chan->obj != NULL) { -- 2.34.1