n--;// compensate mypolls.remove_index_fast(n) and n++ of loop
continue;
}
}
}
}
#endif // IDLE_THREADS
if(unlikely(myds->wait_until)){
tune_timeout_for_myds_needs_pause(myds);
}
if(myds->sess){
if(unlikely(myds->sess->pause_until>0)){
tune_timeout_for_session_needs_pause(myds);
}
}
myds->revents=0;
if(myds->myds_type!=MYDS_LISTENER){
configure_pollout(myds,n);
}
}
proxy_debug(PROXY_DEBUG_NET,1,"Poll for DataStream=%p will be called with FD=%d and events=%d\n",mypolls.myds[n],mypolls.fds[n].fd,mypolls.fds[n].events);
}
}
// this function was inline in MySQL_Thread::run()
voidMySQL_Thread::ProcessAllMyDS_AfterPoll(){
intrc;
for(unsignedintn=0;n<mypolls.len;n++){
proxy_debug(PROXY_DEBUG_NET,3,"poll for fd %d events %d revents %d\n",mypolls.fds[n].fd,mypolls.fds[n].events,mypolls.fds[n].revents);
MySQL_Data_Stream*myds=mypolls.myds[n];
if(myds==NULL){
read_one_byte_from_pipe(n);
continue;
}
if(mypolls.fds[n].revents==0){
if(poll_timeout_bool){
check_timing_out_session(n);
}
}else{
check_for_invalid_fd(n);// this is designed to assert in case of failure
switch(myds->myds_type){
// Note: this logic that was here was removed completely because we added mariadb client library.
caseMYDS_LISTENER:
// we got a new connection!
listener_handle_new_connection(myds,n);
continue;
break;
default:
break;
}
// data on exiting connection
boolrc=process_data_on_data_stream(myds,n);
if(rc==false){
n--;
}
}
}
}
// this function was inline in MySQL_Thread::run()
n--;// compensate mypolls.remove_index_fast(n) and n++ of loop
continue;
}
}
}
}
#endif // IDLE_THREADS
if(unlikely(myds->wait_until)){
tune_timeout_for_myds_needs_pause(myds);
}
if(myds->sess){
if(unlikely(myds->sess->pause_until>0)){
tune_timeout_for_session_needs_pause(myds);
}
}
myds->revents=0;
if(myds->myds_type!=MYDS_LISTENER){
configure_pollout(myds,n);
}
}
proxy_debug(PROXY_DEBUG_NET,1,"Poll for DataStream=%p will be called with FD=%d and events=%d\n",mypolls.myds[n],mypolls.fds[n].fd,mypolls.fds[n].events);
proxy_warning("Killing client connection %s:%d because of (possible) transaction idle for %llums\n",sess->client_myds->addr.addr,sess->client_myds->addr.port,sess_time/1000);
proxy_warning("Killing client connection %s:%d because inactive for %llums\n",sess->client_myds->addr.addr,sess->client_myds->addr.port,sess_time/1000);
}
}
}
}else{
if(sess->active_transactions>0){
// here is all the logic related to max_transaction_time
proxy_warning("Killing client connection %s:%d because of (possible) transaction running for %llums\n",sess->client_myds->addr.addr,sess->client_myds->addr.port,trx_time_ms);
}
}
}
}
}
if(servers_table_version_current!=servers_table_version_previous){// bug fix for #1085
// Immediatelly kill all client connections using an OFFLINE node when session_fast_forward == true
if(sess->session_fast_forward){
if(sess->HasOfflineBackends()){
sess->killed=true;
proxy_warning("Killing client connection %s:%d due to 'session_fast_forward' and offline backends\n",sess->client_myds->addr.addr,sess->client_myds->addr.port);
}
}else{
// Search for connections that should be terminated, and simulate data in them
// the following 2 lines of code replace the previous 2 lines
// instead of killing the sessions, fails the backend connections
proxy_warning("Killing client connection %s:%d because of (possible) transaction idle for %llums\n",sess->client_myds->addr.addr,sess->client_myds->addr.port,sess_time/1000);
proxy_warning("Killing client connection %s:%d because inactive for %llums\n",sess->client_myds->addr.addr,sess->client_myds->addr.port,sess_time/1000);
}
}
}
}else{
if(sess->active_transactions>0){
// here is all the logic related to max_transaction_time
proxy_warning("Killing client connection %s:%d because of (possible) transaction running for %llums\n",sess->client_myds->addr.addr,sess->client_myds->addr.port,trx_time_ms);
}
}
}
}
}
if(servers_table_version_current!=servers_table_version_previous){// bug fix for #1085
// Immediatelly kill all client connections using an OFFLINE node when session_fast_forward == true
if(sess->session_fast_forward){
if(sess->HasOfflineBackends()){
sess->killed=true;
proxy_warning("Killing client connection %s:%d due to 'session_fast_forward' and offline backends\n",sess->client_myds->addr.addr,sess->client_myds->addr.port);
}
}
else{
// Search for connections that should be terminated, and simulate data in them
// the following 2 lines of code replace the previous 2 lines
// instead of killing the sessions, fails the backend connections