If client disconnect, active backends are destroyed

pull/190/head
René Cannaò 11 years ago
parent 71ca1453fc
commit 3e41779f7e

@ -123,9 +123,9 @@ MySQL_Session::~MySQL_Session() {
if (client_myds) {
delete client_myds;
}
if (server_myds) {
delete server_myds;
}
//if (server_myds) {
// delete server_myds;
//}
reset_all_backends();
delete mybes;
proxy_debug(PROXY_DEBUG_NET,1,"Thread=%p, Session=%p -- Shutdown Session %p\n" , this->thread, this, this);

@ -577,7 +577,7 @@ virtual void run() {
proxy_debug(PROXY_DEBUG_NET,5,"%s\n", "Returning poll");
curtime=monotonic_time();
if (curtime>oldtime+mysql_thread___poll_timeout) {
if (curtime>(oldtime+(mysql_thread___poll_timeout*1000))) {
oldtime=curtime;
GloQPro->update_query_processor_stats();
}

@ -155,12 +155,8 @@ MySQL_Backend::~MySQL_Backend() {
}
void MySQL_Backend::reset() {
if (server_myds) {
//delete server_myds;
server_myds=NULL;
}
if (myconn) {
if (myconn->reusable==true && ((myconn->myds->sess->myprot_server.prot_status & SERVER_STATUS_IN_TRANS)==0)) {
if (server_myds->DSS==STATE_READY && myconn->reusable==true && ((myconn->myds->sess->myprot_server.prot_status & SERVER_STATUS_IN_TRANS)==0)) {
//server_myds->myconn=NULL;
//delete myconn;
MyHGM->push_MyConn_to_pool(myconn);
@ -169,12 +165,16 @@ void MySQL_Backend::reset() {
} else {
// MyConnArray *MCA=MyConnPool->MyConnArray_lookup(myconn->mshge->MSptr->address, myconn->myconn.user, myconn->mshge->MSptr->password, myconn->mshge->MSptr->db, myconn->mshge->MSptr->port);
MyHGM->destroy_MyConn_from_pool(myconn);
delete myconn;
//delete myconn;
}
};
//if (mshge) {
// FIXME: what to do with it?
//}
if (server_myds) {
delete server_myds;
//server_myds=NULL;
}
}

@ -99,6 +99,12 @@ MySQL_Connection::~MySQL_Connection() {
delete userinfo;
userinfo=NULL;
}
if (myds) {
myds->shut_hard();
} else {
shutdown(fd, SHUT_RDWR);
close(fd);
}
};

Loading…
Cancel
Save