We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01d994b commit 5b4e69cCopy full SHA for 5b4e69c
sql/threadpool_win.cc
@@ -355,10 +355,13 @@ int TP_pool_win::init()
355
if (IS_SYSVAR_AUTOSIZE(&threadpool_max_threads))
356
{
357
/*
358
- Nr 500 comes from Microsoft documentation,
359
- there is no API for GetThreadpoolThreadMaxThreads()
+ Default 500 comes from Microsoft documentation,
+ there is no API for GetThreadpoolThreadMaxThreads().
360
+
361
+ To avoid deadlocks, allow at least max_connections + safety
362
+ margin threads in the pool.
363
*/
- SYSVAR_AUTOSIZE(threadpool_max_threads,500);
364
+ SYSVAR_AUTOSIZE(threadpool_max_threads,std::max(500U,(uint)max_connections + 10));
365
}
366
else
367
0 commit comments