Adapt session timeout checks to a per thread model

Each thread will now check their own list of DCBs for timed out sessions.
This commit is contained in:
Markus Makela
2016-11-20 10:34:37 +02:00
parent 30927455ef
commit 5067f3594a
6 changed files with 47 additions and 66 deletions

View File

@ -377,6 +377,8 @@ int dcb_accept_SSL(DCB* dcb);
int dcb_connect_SSL(DCB* dcb);
int dcb_listen(DCB *listener, const char *config, const char *protocol_name);
void dcb_append_readqueue(DCB *dcb, GWBUF *buffer);
void dcb_enable_session_timeouts();
void dcb_process_idle_sessions(int thr);
/**
* DCB flags values

View File

@ -185,13 +185,6 @@ typedef struct session
.stats = SESSION_STATS_INIT, .head = DOWNSTREAM_INIT, .tail = UPSTREAM_INIT, \
.state = SESSION_STATE_ALLOC, .ses_chk_tail = CHK_NUM_SESSION}
/** Whether to do session timeout checks */
extern bool check_timeouts;
/** When the next timeout check is done. This is compared to hkheartbeat in
* hk_heartbeat.h */
extern long next_timeout_check;
#define SESSION_PROTOCOL(x, type) DCB_PROTOCOL((x)->client_dcb, type)
/**
@ -231,8 +224,6 @@ SESSION* get_session_by_router_ses(void* rses);
void session_enable_log_priority(SESSION* ses, int priority);
void session_disable_log_priority(SESSION* ses, int priority);
RESULTSET *sessionGetList(SESSIONLISTFILTER);
void process_idle_sessions();
void enable_session_timeouts();
/**
* Get the transaction state of the session.