From e371964f8bc617bb3d56527bc5bb7cfe0ea21f57 Mon Sep 17 00:00:00 2001 From: Niclas Antti Date: Tue, 13 Nov 2018 17:20:39 +0200 Subject: [PATCH] MXS-2057 Add log output for system test, and two random code fixes --- maxscale-system-test/testconnections.cpp | 1 + maxutils/maxbase/include/maxbase/stopwatch.hh | 2 +- server/core/routingworker.cc | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index 510f7456c..5ed609fd1 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -1255,6 +1255,7 @@ static int read_log(const char* name, char** err_log_content_p) err_log_content[size] = '\0'; // printf("s=%ld\n", strlen(err_log_content)); * err_log_content_p = err_log_content; + fclose(f); return 0; } else diff --git a/maxutils/maxbase/include/maxbase/stopwatch.hh b/maxutils/maxbase/include/maxbase/stopwatch.hh index b0069f915..9ed4ce9f6 100644 --- a/maxutils/maxbase/include/maxbase/stopwatch.hh +++ b/maxutils/maxbase/include/maxbase/stopwatch.hh @@ -49,7 +49,7 @@ struct Duration : public Clock::duration } /** To seconds */ - double secs() + double secs() const { return std::chrono::duration(*this).count(); } diff --git a/server/core/routingworker.cc b/server/core/routingworker.cc index 72096dbff..6e2639cc4 100644 --- a/server/core/routingworker.cc +++ b/server/core/routingworker.cc @@ -1020,6 +1020,7 @@ void RoutingWorker::check_systemd_watchdog() { s_watchdog_next_check = now + s_watchdog_interval; #ifdef HAVE_SYSTEMD + MXS_DEBUG("systemd watchdog keep-alive ping: sd_notify(false, \"WATCHDOG=1\")"); sd_notify(false, "WATCHDOG=1"); #endif std::for_each(this_unit.ppWorkers, this_unit.ppWorkers + this_unit.nWorkers,