fix/TS-5532-set-seperate-thread-update-status-fix-case
This commit is contained in:
parent
9ef4e45171
commit
66dbc6c161
|
@ -28,6 +28,7 @@ typedef struct SDnodeMgmt {
|
||||||
const char *path;
|
const char *path;
|
||||||
const char *name;
|
const char *name;
|
||||||
TdThread statusThread;
|
TdThread statusThread;
|
||||||
|
TdThread statusInfoThread;
|
||||||
TdThread notifyThread;
|
TdThread notifyThread;
|
||||||
TdThread monitorThread;
|
TdThread monitorThread;
|
||||||
TdThread auditThread;
|
TdThread auditThread;
|
||||||
|
@ -65,6 +66,7 @@ int32_t dmPutNodeMsgToMgmtQueue(SDnodeMgmt *pMgmt, SRpcMsg *pMsg);
|
||||||
int32_t dmStartStatusThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartStatusThread(SDnodeMgmt *pMgmt);
|
||||||
int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt);
|
||||||
void dmStopStatusThread(SDnodeMgmt *pMgmt);
|
void dmStopStatusThread(SDnodeMgmt *pMgmt);
|
||||||
|
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt);
|
||||||
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt);
|
||||||
void dmStopNotifyThread(SDnodeMgmt *pMgmt);
|
void dmStopNotifyThread(SDnodeMgmt *pMgmt);
|
||||||
int32_t dmStartMonitorThread(SDnodeMgmt *pMgmt);
|
int32_t dmStartMonitorThread(SDnodeMgmt *pMgmt);
|
||||||
|
|
|
@ -47,6 +47,7 @@ static void dmStopMgmt(SDnodeMgmt *pMgmt) {
|
||||||
dmStopMonitorThread(pMgmt);
|
dmStopMonitorThread(pMgmt);
|
||||||
dmStopAuditThread(pMgmt);
|
dmStopAuditThread(pMgmt);
|
||||||
dmStopStatusThread(pMgmt);
|
dmStopStatusThread(pMgmt);
|
||||||
|
dmStopStatusInfoThread(pMgmt);
|
||||||
#if defined(TD_ENTERPRISE)
|
#if defined(TD_ENTERPRISE)
|
||||||
dmStopNotifyThread(pMgmt);
|
dmStopNotifyThread(pMgmt);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -314,7 +314,7 @@ int32_t dmStartStatusInfoThread(SDnodeMgmt *pMgmt) {
|
||||||
TdThreadAttr thAttr;
|
TdThreadAttr thAttr;
|
||||||
(void)taosThreadAttrInit(&thAttr);
|
(void)taosThreadAttrInit(&thAttr);
|
||||||
(void)taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE);
|
(void)taosThreadAttrSetDetachState(&thAttr, PTHREAD_CREATE_JOINABLE);
|
||||||
if (taosThreadCreate(&pMgmt->statusThread, &thAttr, dmStatusInfoThreadFp, pMgmt) != 0) {
|
if (taosThreadCreate(&pMgmt->statusInfoThread, &thAttr, dmStatusInfoThreadFp, pMgmt) != 0) {
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
code = TAOS_SYSTEM_ERROR(errno);
|
||||||
dError("failed to create status Info thread since %s", tstrerror(code));
|
dError("failed to create status Info thread since %s", tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
|
@ -332,6 +332,13 @@ void dmStopStatusThread(SDnodeMgmt *pMgmt) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dmStopStatusInfoThread(SDnodeMgmt *pMgmt) {
|
||||||
|
if (taosCheckPthreadValid(pMgmt->statusInfoThread)) {
|
||||||
|
(void)taosThreadJoin(pMgmt->statusInfoThread, NULL);
|
||||||
|
taosThreadClear(&pMgmt->statusInfoThread);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt) {
|
int32_t dmStartNotifyThread(SDnodeMgmt *pMgmt) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
TdThreadAttr thAttr;
|
TdThreadAttr thAttr;
|
||||||
|
|
Loading…
Reference in New Issue