MXS-2178 Add WD workaround to REST-API and maxadmin
This commit is contained in:
@ -1327,10 +1327,11 @@ static HttpResponse handle_request(const HttpRequest& request)
|
|||||||
|
|
||||||
HttpResponse resource_handle_request(const HttpRequest& request)
|
HttpResponse resource_handle_request(const HttpRequest& request)
|
||||||
{
|
{
|
||||||
mxb::Worker* worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
|
mxs::RoutingWorker* worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
|
||||||
|
|
||||||
HttpResponse response;
|
HttpResponse response;
|
||||||
worker->call([&request, &response]() {
|
worker->call([&request, &response, worker]() {
|
||||||
|
mxs::WatchdogWorkaround workaround(worker);
|
||||||
response = handle_request(request);
|
response = handle_request(request);
|
||||||
},
|
},
|
||||||
mxb::Worker::EXECUTE_AUTO);
|
mxb::Worker::EXECUTE_AUTO);
|
||||||
|
@ -27,19 +27,19 @@
|
|||||||
|
|
||||||
#define MXS_MODULE_NAME "cli"
|
#define MXS_MODULE_NAME "cli"
|
||||||
|
|
||||||
|
#include <debugcli.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <maxbase/atomic.h>
|
||||||
|
#include <maxscale/alloc.h>
|
||||||
|
#include <maxscale/dcb.h>
|
||||||
|
#include <maxscale/log.h>
|
||||||
|
#include <maxscale/modinfo.h>
|
||||||
|
#include <maxscale/poll.h>
|
||||||
|
#include <maxscale/router.h>
|
||||||
#include <maxscale/service.h>
|
#include <maxscale/service.h>
|
||||||
#include <maxscale/session.h>
|
#include <maxscale/session.h>
|
||||||
#include <maxscale/router.h>
|
|
||||||
#include <maxscale/modinfo.h>
|
|
||||||
#include <maxbase/atomic.h>
|
|
||||||
#include <maxscale/dcb.h>
|
|
||||||
#include <maxscale/alloc.h>
|
|
||||||
#include <maxscale/poll.h>
|
|
||||||
#include <debugcli.h>
|
|
||||||
#include <maxscale/log.h>
|
|
||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params);
|
static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params);
|
||||||
|
@ -26,19 +26,19 @@
|
|||||||
|
|
||||||
#define MXS_MODULE_NAME "debugcli"
|
#define MXS_MODULE_NAME "debugcli"
|
||||||
|
|
||||||
|
#include <debugcli.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <maxbase/atomic.h>
|
||||||
|
#include <maxscale/alloc.h>
|
||||||
|
#include <maxscale/dcb.h>
|
||||||
|
#include <maxscale/log.h>
|
||||||
|
#include <maxscale/modinfo.h>
|
||||||
|
#include <maxscale/poll.h>
|
||||||
|
#include <maxscale/router.h>
|
||||||
#include <maxscale/service.h>
|
#include <maxscale/service.h>
|
||||||
#include <maxscale/session.h>
|
#include <maxscale/session.h>
|
||||||
#include <maxscale/router.h>
|
|
||||||
#include <maxscale/modinfo.h>
|
|
||||||
#include <maxbase/atomic.h>
|
|
||||||
#include <maxscale/dcb.h>
|
|
||||||
#include <maxscale/alloc.h>
|
|
||||||
#include <maxscale/poll.h>
|
|
||||||
#include <debugcli.h>
|
|
||||||
#include <maxscale/log.h>
|
|
||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params);
|
static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params);
|
||||||
|
@ -35,9 +35,9 @@
|
|||||||
#include <sys/syslog.h>
|
#include <sys/syslog.h>
|
||||||
#include <telnetd.h>
|
#include <telnetd.h>
|
||||||
|
|
||||||
|
#include <maxbase/atomic.h>
|
||||||
#include <maxscale/adminusers.h>
|
#include <maxscale/adminusers.h>
|
||||||
#include <maxscale/alloc.h>
|
#include <maxscale/alloc.h>
|
||||||
#include <maxbase/atomic.h>
|
|
||||||
#include <maxscale/buffer.h>
|
#include <maxscale/buffer.h>
|
||||||
#include <maxscale/config.h>
|
#include <maxscale/config.h>
|
||||||
#include <maxscale/dcb.h>
|
#include <maxscale/dcb.h>
|
||||||
@ -47,13 +47,12 @@
|
|||||||
#include <maxscale/maxscale.h>
|
#include <maxscale/maxscale.h>
|
||||||
#include <maxscale/modulecmd.h>
|
#include <maxscale/modulecmd.h>
|
||||||
#include <maxscale/router.h>
|
#include <maxscale/router.h>
|
||||||
|
#include <maxscale/routingworker.hh>
|
||||||
#include <maxscale/server.hh>
|
#include <maxscale/server.hh>
|
||||||
#include <maxscale/service.h>
|
#include <maxscale/service.h>
|
||||||
#include <maxscale/users.h>
|
#include <maxscale/users.h>
|
||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
#include <maxscale/version.h>
|
#include <maxscale/version.h>
|
||||||
#include <maxscale/routingworker.h>
|
|
||||||
#include <maxscale/routingworker.hh>
|
|
||||||
|
|
||||||
#include <debugcli.h>
|
#include <debugcli.h>
|
||||||
|
|
||||||
@ -2102,6 +2101,10 @@ static const char item_separator[] =
|
|||||||
*/
|
*/
|
||||||
int execute_cmd(CLI_SESSION* cli)
|
int execute_cmd(CLI_SESSION* cli)
|
||||||
{
|
{
|
||||||
|
mxs::RoutingWorker* worker = mxs::RoutingWorker::get_current();
|
||||||
|
mxb_assert(worker == mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN));
|
||||||
|
mxs::WatchdogWorkaround workaround(worker);
|
||||||
|
|
||||||
DCB* dcb = cli->session->client_dcb;
|
DCB* dcb = cli->session->client_dcb;
|
||||||
int argc, i, j, found = 0;
|
int argc, i, j, found = 0;
|
||||||
char* args[MAXARGS + 4];
|
char* args[MAXARGS + 4];
|
||||||
|
Reference in New Issue
Block a user