解决参数max_processes=200000+开启线程池,启动数据库coredump 的问题

This commit is contained in:
laishenghao
2023-02-18 09:48:58 +08:00
parent 8d5b8af09c
commit c9baf1bd5b
3 changed files with 11 additions and 2 deletions

View File

@ -55,6 +55,7 @@
status == STATE_STREAM_WAIT_CONNECT_NODES || \
status == STATE_STREAM_WAIT_PRODUCER_READY || \
status == STATE_WAIT_XACTSYNC)
#define WAIT_READY_MAX_TIMES 10000
ThreadPoolGroup::ThreadPoolGroup(int maxWorkerNum, int expectWorkerNum, int maxStreamNum,
int groupId, int numaId, int cpuNum, int* cpuArr, bool enableBindCpuNuma)
@ -192,12 +193,16 @@ void ThreadPoolGroup::ReleaseWorkerSlot(int i)
void ThreadPoolGroup::WaitReady()
{
while (true) {
int cnt = 0;
while (cnt++ < WAIT_READY_MAX_TIMES) {
if (m_listenerNum == 1) {
break;
}
pg_usleep(500);
}
if (m_listenerNum != 1) {
ereport(ERROR, (errmsg_internal("ThreadPoolGroup::WaitReady() timeout, m_listenerNum= %d", m_listenerNum)));
}
}
float4 ThreadPoolGroup::GetSessionPerThread()