Execute service_internal_restart on main worker
The task needs to be executed on a routing worker as it accesses authenticator data that at least for MySQLAuth is worker specific.
This commit is contained in:
@ -1304,8 +1304,14 @@ std::unique_ptr<ResultSet> serviceGetList()
|
|||||||
*/
|
*/
|
||||||
static bool service_internal_restart(void* data)
|
static bool service_internal_restart(void* data)
|
||||||
{
|
{
|
||||||
Service* service = (Service*)data;
|
auto func = [=]() {
|
||||||
|
Service* service = static_cast<Service*>(data);
|
||||||
serviceStartAllPorts(service);
|
serviceStartAllPorts(service);
|
||||||
|
};
|
||||||
|
|
||||||
|
auto worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
|
||||||
|
worker->execute(func, nullptr, mxs::RoutingWorker::EXECUTE_AUTO);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user