Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä 2020-01-14 10:10:58 +02:00
commit 3ed30327e5
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
6 changed files with 7 additions and 32 deletions

View File

@ -54,6 +54,8 @@ then
mkdir -p /usr/lib/systemd/system/maxscale.service.d
systemctl daemon-reload
fi
systemctl enable maxscale.service
else
if [ -d "/etc/init/" ] && [ -f "@CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/upstart/maxscale.conf" ]
then

View File

@ -17,9 +17,11 @@ then
if [ -f /usr/lib/systemd/system/maxscale.service ]
then
systemd stop maxscale.service
rm /usr/lib/systemd/system/maxscale.service
elif [ -f /lib/systemd/system/maxscale.service ]
then
systemd stop maxscale.service
rm /lib/systemd/system/maxscale.service
fi

View File

@ -1,3 +1,3 @@
sleep 5
sudo /usr/bin/killall maxscale -s INT
sudo /usr/bin/killall maxscale -s INT || sudo pkill -INT maxscale

View File

@ -10,7 +10,7 @@ fi
T="$(date +%s)"
sudo maxscale -d -U root
sudo maxscale -d -U maxscale
if [ $? -ne 0 ] ; then
exit 1
fi

View File

@ -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)

View File

@ -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));
}