fix threadpool

This commit is contained in:
LiHeng
2021-08-04 16:48:04 +08:00
parent 0cd52e3783
commit f09db307e1
4 changed files with 39 additions and 7 deletions

View File

@ -558,11 +558,10 @@ void ThreadPoolControler::ConstrainThreadNum()
{
/* Thread pool size should not be larger than max_connections. */
if (MAX_THREAD_POOL_SIZE > g_instance.attr.attr_network.MaxConnections) {
m_maxPoolSize = g_instance.attr.attr_network.MaxConnections;
ereport(LOG, (errcode(ERRCODE_OPERATE_INVALID_PARAM),
errmsg("Thread pool size %d should not be larger than max_connections %d, "
"so reduce thread pool size to max_connections",
m_threadNum, g_instance.attr.attr_network.MaxConnections)));
errmsg("Max thread pool size %d should not be larger than max_connections %d, "
"so reduce max thread pool size to max_connections",
MAX_THREAD_POOL_SIZE, g_instance.attr.attr_network.MaxConnections)));
}
m_maxPoolSize = Min(MAX_THREAD_POOL_SIZE, g_instance.attr.attr_network.MaxConnections);