Write slave heartbeat in correct thread
The writing should be done on the worker that owns the DCB.
This commit is contained in:
@ -47,6 +47,7 @@
|
||||
#include <maxscale/service.h>
|
||||
#include <maxscale/utils.h>
|
||||
#include <maxscale/version.h>
|
||||
#include <maxscale/routingworker.hh>
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
@ -6305,7 +6306,11 @@ static int blr_slave_send_heartbeat(ROUTER_INSTANCE* router, ROUTER_SLAVE* slave
|
||||
}
|
||||
|
||||
/* Write the packet */
|
||||
return MXS_SESSION_ROUTE_REPLY(slave->dcb->session, h_event);
|
||||
mxs::RoutingWorker* worker = (mxs::RoutingWorker*)slave->dcb->poll.owner;
|
||||
worker->execute([slave, h_event]() {
|
||||
MXS_SESSION_ROUTE_REPLY(slave->dcb->session, h_event);
|
||||
}, mxs::RoutingWorker::EXECUTE_AUTO);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user