Fix maxinfo/maxadmin debug assertion

Both services could write to a DCB from a worker that doesn't own it.
This commit is contained in:
Markus Mäkelä 2019-05-10 10:52:23 +03:00
parent 142038051c
commit b10fc196a1
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -1475,7 +1475,13 @@ static void gw_process_one_new_client(DCB* client_dcb)
}
else
{
MySQLSendHandshake(client_dcb);
// It's possible that the DCB isn't owned by the chosen worker if it's a
// maxadmin/maxinfo service. In this case the execution must be moved to the
// owning worker.
auto worker = static_cast<mxs::RoutingWorker*>(client_dcb->poll.owner);
worker->execute([=]() {
MySQLSendHandshake(client_dcb);
}, mxs::RoutingWorker::EXECUTE_AUTO);
}
}, mxs::RoutingWorker::EXECUTE_AUTO);
}