diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2020-07-28 15:59:38 +0200 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2020-07-30 10:17:45 +0200 |
commit | 71015d844e3f25a0c4eada9827a1dad464a4fdce (patch) | |
tree | 559fad43bb05477098b15df4476c5ccfd3135c0d /sql/threadpool_generic.cc | |
parent | 34f2be3b296fdd5933687eda9c3ef3ba9f707261 (diff) | |
download | mariadb-git-71015d844e3f25a0c4eada9827a1dad464a4fdce.tar.gz |
MDEV-21101 unexpected wait_timeout with pool-of-threads
Due to restricted size of the threadpool, execution of client queries can
be delayed (queued) for a while. This delay was interpreted as client
inactivity, and connection is closed, if client idle time + queue time
exceeds wait_timeout.
But users did not expect queue time to be included into wait_timeout.
This patch changes the behavior. We don't close connection anymore,
if there is some unread data present on connection,
even if wait_timeout is exceeded. Unread data means that client
was not idle, it sent a query, which we did not have time to process yet.
Diffstat (limited to 'sql/threadpool_generic.cc')
-rw-r--r-- | sql/threadpool_generic.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc index 6531ce06360..2433369dbbb 100644 --- a/sql/threadpool_generic.cc +++ b/sql/threadpool_generic.cc @@ -591,11 +591,8 @@ static void timeout_check(pool_timer_t *timer) THD *thd; while ((thd=it++)) { - if (thd->net.reading_or_writing != 1) - continue; - TP_connection_generic *connection= (TP_connection_generic *)thd->event_scheduler.data; - if (!connection) + if (!connection || connection->state != TP_STATE_IDLE) { /* Connection does not have scheduler data. This happens for example |