From 8236ba105157889ebc49554b20a6c46211f1a663 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 19 Nov 2011 12:14:09 -0500 Subject: [PATCH] Handle sessiond application refusal with delayed retry Signed-off-by: Mathieu Desnoyers --- liblttng-ust/lttng-ust-comm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 0b53269d..33651000 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -683,6 +683,20 @@ restart: switch (len) { case 0: /* orderly shutdown */ DBG("%s ltt-sessiond has performed an orderly shutdown\n", sock_info->name); + ust_lock(); + /* + * Either sessiond has shutdown or refused us by closing the socket. + * In either case, we don't want to delay construction execution, + * and we need to wait before retry. + */ + prev_connect_failed = 1; + /* + * If we cannot register to the sessiond daemon, don't + * delay constructor execution. + */ + ret = handle_register_done(sock_info); + assert(!ret); + ust_unlock(); goto end; case sizeof(lum): DBG("message received\n"); @@ -692,6 +706,7 @@ restart: } continue; case -1: + DBG("Receive failed from lttng-sessiond with errno %d", errno); if (errno == ECONNRESET) { ERR("%s remote end closed connection\n", sock_info->name); goto end; -- 2.34.1