Merge branch '2.3' into 2.4
This commit is contained in:
@ -232,23 +232,6 @@ void session_close(MXS_SESSION* session)
|
||||
}
|
||||
}
|
||||
|
||||
class ServiceDestroyTask : public Worker::DisposableTask
|
||||
{
|
||||
public:
|
||||
ServiceDestroyTask(Service* service)
|
||||
: m_service(service)
|
||||
{
|
||||
}
|
||||
|
||||
void execute(Worker& worker) override
|
||||
{
|
||||
service_free(m_service);
|
||||
}
|
||||
|
||||
private:
|
||||
Service* m_service;
|
||||
};
|
||||
|
||||
/**
|
||||
* Deallocate the specified session
|
||||
*
|
||||
@ -1151,7 +1134,6 @@ Session::Session(const SListener& listener)
|
||||
|
||||
mxb::atomic::add(&service->stats.n_current, 1, mxb::atomic::RELAXED);
|
||||
mxb_assert(service->stats.n_current >= 0);
|
||||
mxb::atomic::add(&service->client_count, 1, mxb::atomic::RELAXED);
|
||||
}
|
||||
|
||||
Session::~Session()
|
||||
@ -1169,17 +1151,6 @@ Session::~Session()
|
||||
|
||||
mxb::atomic::add(&service->stats.n_current, -1, mxb::atomic::RELAXED);
|
||||
mxb_assert(service->stats.n_current >= 0);
|
||||
|
||||
bool should_destroy = !mxb::atomic::load(&service->active);
|
||||
|
||||
if (mxb::atomic::add(&service->client_count, -1) == 1 && should_destroy)
|
||||
{
|
||||
// Destroy the service in the main routing worker thread
|
||||
mxs::RoutingWorker* main_worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN);
|
||||
main_worker->execute(
|
||||
std::unique_ptr<ServiceDestroyTask>(new ServiceDestroyTask(static_cast<Service*>(service))),
|
||||
Worker::EXECUTE_AUTO);
|
||||
}
|
||||
}
|
||||
|
||||
void Session::set_client_dcb(DCB* dcb)
|
||||
|
||||
@ -1425,7 +1425,7 @@ static int gw_backend_close(DCB* dcb)
|
||||
|| proto->protocol_auth_state == MXS_AUTH_STATE_CONNECTED)
|
||||
{
|
||||
MYSQL_session client;
|
||||
gw_get_shared_session_auth_info(dcb->session->client_dcb, &client);
|
||||
gw_get_shared_session_auth_info(dcb, &client);
|
||||
memset(proto->scramble, 0, sizeof(proto->scramble));
|
||||
dcb_write(dcb, gw_generate_auth_response(&client, proto, false, false, 0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user