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:
Markus Mäkelä 2018-11-30 20:24:54 +02:00
parent e46104c32a
commit 7ea22c3d16
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -1304,8 +1304,14 @@ std::unique_ptr<ResultSet> serviceGetList()
*/
static bool service_internal_restart(void* data)
{
Service* service = (Service*)data;
serviceStartAllPorts(service);
auto func = [=]() {
Service* service = static_cast<Service*>(data);
serviceStartAllPorts(service);
};
auto worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
worker->execute(func, nullptr, mxs::RoutingWorker::EXECUTE_AUTO);
return false;
}