Merge branch '2.2' into 2.3

This commit is contained in:
Markus Mäkelä
2019-06-19 10:54:37 +03:00
5 changed files with 33 additions and 18 deletions

View File

@ -52,6 +52,7 @@ struct WORKER_STATISTICS
int64_t evq_max = 0; /*< Maximum event queue length */ int64_t evq_max = 0; /*< Maximum event queue length */
int64_t maxqtime = 0; int64_t maxqtime = 0;
int64_t maxexectime = 0; int64_t maxexectime = 0;
std::array<int64_t, MAXNFDS> n_fds {}; /*< Number of wakeups with particular n_fds value */ std::array<int64_t, MAXNFDS> n_fds {}; /*< Number of wakeups with particular n_fds value */
std::array<uint32_t, N_QUEUE_TIMES + 1> qtimes {}; std::array<uint32_t, N_QUEUE_TIMES + 1> qtimes {};
std::array<uint32_t, N_QUEUE_TIMES + 1> exectimes {}; std::array<uint32_t, N_QUEUE_TIMES + 1> exectimes {};

View File

@ -519,9 +519,19 @@ bool Worker::call(function<void ()> func, execute_mode_t mode)
bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2) bool Worker::post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2)
{ {
// NOTE: No logging here, this function must be signal safe. // NOTE: No logging here, this function must be signal safe.
MessageQueue::Message message(msg_id, arg1, arg2); bool rval = false;
return m_pQueue->post(message); // TODO: Enable and fix this in develop and/or 2.4: The deletion of rworker_local is done after the
// workers have stopped and it triggers this assertion.
// mxb_assert(state() != Worker::STOPPED);
if (state() != Worker::STOPPED)
{
MessageQueue::Message message(msg_id, arg1, arg2);
rval = m_pQueue->post(message);
}
return rval;
} }
void Worker::run(mxb::Semaphore* pSem) void Worker::run(mxb::Semaphore* pSem)

View File

@ -424,6 +424,7 @@ bool mxs_admin_init()
void mxs_admin_shutdown() void mxs_admin_shutdown()
{ {
MHD_stop_daemon(http_daemon); MHD_stop_daemon(http_daemon);
MXS_NOTICE("Stopped MaxScale REST API");
} }
bool mxs_admin_https_enabled() bool mxs_admin_https_enabled()

View File

@ -2255,9 +2255,6 @@ int main(int argc, char** argv)
mxb_assert(worker); mxb_assert(worker);
worker->run(); worker->run();
/** Stop administrative interface */
mxs_admin_shutdown();
/*< Stop all monitors */ /*< Stop all monitors */
monitor_stop_all(); monitor_stop_all();

View File

@ -19,6 +19,7 @@
#include "internal/maxscale.h" #include "internal/maxscale.h"
#include "internal/service.hh" #include "internal/service.hh"
#include "internal/admin.hh"
static time_t started; static time_t started;
@ -50,7 +51,12 @@ int maxscale_shutdown()
if (n == 0) if (n == 0)
{ {
auto w = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
w->execute(
[]() {
mxs_admin_shutdown();
mxs::RoutingWorker::shutdown_all(); mxs::RoutingWorker::shutdown_all();
}, nullptr, mxs::RoutingWorker::EXECUTE_QUEUED);
} }
return n + 1; return n + 1;