Merge pull request #29222 from taosdata/fix/main/TD-33280
Fix(cfg): fix core at dmConfigThreadFp.
This commit is contained in:
commit
648412750b
|
@ -69,6 +69,7 @@ int32_t dmStartStatusThread(SDnodeMgmt *pMgmt);
|
||||||
int32_t dmStartConfigThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartConfigThread(SDnodeMgmt *pMgmt);
|
||||||
int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt);
|
||||||
void dmStopStatusThread(SDnodeMgmt *pMgmt);
|
void dmStopStatusThread(SDnodeMgmt *pMgmt);
|
||||||
|
void dmStopConfigThread(SDnodeMgmt *pMgmt);
|
||||||
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt);
|
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt);
|
||||||
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt);
|
||||||
void dmStopNotifyThread(SDnodeMgmt *pMgmt);
|
void dmStopNotifyThread(SDnodeMgmt *pMgmt);
|
||||||
|
|
|
@ -52,6 +52,7 @@ static void dmStopMgmt(SDnodeMgmt *pMgmt) {
|
||||||
dmStopMonitorThread(pMgmt);
|
dmStopMonitorThread(pMgmt);
|
||||||
dmStopAuditThread(pMgmt);
|
dmStopAuditThread(pMgmt);
|
||||||
dmStopStatusThread(pMgmt);
|
dmStopStatusThread(pMgmt);
|
||||||
|
dmStopConfigThread(pMgmt);
|
||||||
dmStopStatusInfoThread(pMgmt);
|
dmStopStatusInfoThread(pMgmt);
|
||||||
#if defined(TD_ENTERPRISE)
|
#if defined(TD_ENTERPRISE)
|
||||||
dmStopNotifyThread(pMgmt);
|
dmStopNotifyThread(pMgmt);
|
||||||
|
|
|
@ -343,7 +343,7 @@ int32_t dmStartConfigThread(SDnodeMgmt *pMgmt) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
TdThreadAttr thAttr;
|
TdThreadAttr thAttr;
|
||||||
(void)taosThreadAttrInit(&thAttr);
|
(void)taosThreadAttrInit(&thAttr);
|
||||||
(void)taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_DETACHED);
|
(void)taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE);
|
||||||
if (taosThreadCreate(&pMgmt->configThread, &thAttr, dmConfigThreadFp, pMgmt) != 0) {
|
if (taosThreadCreate(&pMgmt->configThread, &thAttr, dmConfigThreadFp, pMgmt) != 0) {
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
code = TAOS_SYSTEM_ERROR(errno);
|
||||||
dError("failed to create config thread since %s", tstrerror(code));
|
dError("failed to create config thread since %s", tstrerror(code));
|
||||||
|
@ -378,6 +378,13 @@ void dmStopStatusThread(SDnodeMgmt *pMgmt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dmStopConfigThread(SDnodeMgmt *pMgmt) {
|
||||||
|
if (taosCheckPthreadValid(pMgmt->configThread)) {
|
||||||
|
(void)taosThreadJoin(pMgmt->configThread, NULL);
|
||||||
|
taosThreadClear(&pMgmt->configThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt) {
|
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt) {
|
||||||
if (taosCheckPthreadValid(pMgmt->statusInfoThread)) {
|
if (taosCheckPthreadValid(pMgmt->statusInfoThread)) {
|
||||||
(void)taosThreadJoin(pMgmt->statusInfoThread, NULL);
|
(void)taosThreadJoin(pMgmt->statusInfoThread, NULL);
|
||||||
|
|
Loading…
Reference in New Issue