!230 在openGauss 主备环境上进行 业务并发测试 GTT表产生coredump

Merge pull request !230 from wangzhijun/master
This commit is contained in:
opengauss-bot
2020-09-17 19:12:22 +08:00
committed by Gitee
2 changed files with 5 additions and 2 deletions

View File

@ -4674,6 +4674,8 @@ TransactionId ListAllSessionGttFrozenxids(int maxSize, ThreadId *pids, Transacti
}
ThreadPoolSessControl *sessCtrl = g_threadPoolControler->GetSessionCtrl();
AutoMutexLock alock(sessCtrl->GetSessionCtrlLock());
alock.lock();
const knl_sess_control *sessList = sessCtrl->GetSessionList();
const knl_sess_control *currSess = sessList;
while (currSess != nullptr) {
@ -4694,6 +4696,7 @@ TransactionId ListAllSessionGttFrozenxids(int maxSize, ThreadId *pids, Transacti
}
currSess = currSess->next;
}
alock.unLock();
if (maxSize > 0) {
*n = i;

View File

@ -88,9 +88,9 @@ public:
return m_activelist;
}
inline pthread_mutex_t GetSessionCtrlLock()
inline pthread_mutex_t* GetSessionCtrlLock()
{
return m_sessCtrlock;
return &m_sessCtrlock;
}
private: