Fixed idle session processing
The current implementation of idle connection timeouts is not safe. The sessions are handled in a way which is not thread-safe and the checking is done from a non-polling thread. With this change, the checks for the session timeouts are done in one of the polling threads in a thread-safe manner only if at least one service has enabled the timing out of idle client connections.
This commit is contained in:
@ -35,6 +35,7 @@
|
||||
#include <maxconfig.h>
|
||||
#include <mysql.h>
|
||||
#include <resultset.h>
|
||||
#include <session.h>
|
||||
|
||||
#define PROFILE_POLL 0
|
||||
|
||||
@ -705,6 +706,11 @@ poll_waitevents(void *arg)
|
||||
timeout_bias = 1;
|
||||
}
|
||||
|
||||
if (check_timeouts && hkheartbeat >= next_timeout_check)
|
||||
{
|
||||
process_idle_sessions();
|
||||
}
|
||||
|
||||
if (thread_data)
|
||||
{
|
||||
thread_data[thread_id].state = THREAD_ZPROCESSING;
|
||||
|
Reference in New Issue
Block a user