MXS-2149 Add REST-API watchdog
This will simply cause a task to be posted to each worker. If the workers are running normally, the task will reach the workers and the associated semaphore posted, and the REST-API call will return. If any worker is not running normally, the task will not be processed and the REST-API call will hang.
This commit is contained in:
@ -1167,3 +1167,28 @@ json_t* mxs_rworker_list_to_json(const char* host)
|
||||
RoutingWorker::execute_concurrently(task);
|
||||
return task.resource();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
class WatchdogTask : public Worker::Task
|
||||
{
|
||||
public:
|
||||
WatchdogTask()
|
||||
{
|
||||
}
|
||||
|
||||
void execute(Worker& worker)
|
||||
{
|
||||
// Success if this is called.
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
void mxs_rworker_watchdog()
|
||||
{
|
||||
MXS_INFO("MaxScale watchdog called.");
|
||||
WatchdogTask task;
|
||||
RoutingWorker::execute_concurrently(task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user