fix/TS-5532-set-seperate-thread-update-status
This commit is contained in:
parent
c454d0f076
commit
f05ad0a553
|
@ -47,7 +47,6 @@ static void *dmStatusThreadFp(void *param) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern SMonVloadInfo tsVinfo;
|
|
||||||
static void *dmStatusInfoThreadFp(void *param) {
|
static void *dmStatusInfoThreadFp(void *param) {
|
||||||
SDnodeMgmt *pMgmt = param;
|
SDnodeMgmt *pMgmt = param;
|
||||||
int64_t lastTime = taosGetTimestampMs();
|
int64_t lastTime = taosGetTimestampMs();
|
||||||
|
@ -73,19 +72,6 @@ static void *dmStatusInfoThreadFp(void *param) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dDebug("begin to lock status info when thread exit");
|
|
||||||
if (taosThreadMutexLock(&pMgmt->pData->statusInfolock) != 0) {
|
|
||||||
dError("failed to lock status info lock");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
if (tsVinfo.pVloads != NULL) {
|
|
||||||
taosArrayDestroy(tsVinfo.pVloads);
|
|
||||||
tsVinfo.pVloads = NULL;
|
|
||||||
}
|
|
||||||
if (taosThreadMutexUnlock(&pMgmt->pData->statusInfolock) != 0) {
|
|
||||||
dError("failed to unlock status info lock");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,6 +219,7 @@ int32_t dmInitVars(SDnode *pDnode) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern SMonVloadInfo tsVinfo;
|
||||||
void dmClearVars(SDnode *pDnode) {
|
void dmClearVars(SDnode *pDnode) {
|
||||||
for (EDndNodeType ntype = DNODE; ntype < NODE_END; ++ntype) {
|
for (EDndNodeType ntype = DNODE; ntype < NODE_END; ++ntype) {
|
||||||
SMgmtWrapper *pWrapper = &pDnode->wrappers[ntype];
|
SMgmtWrapper *pWrapper = &pDnode->wrappers[ntype];
|
||||||
|
@ -254,6 +255,23 @@ void dmClearVars(SDnode *pDnode) {
|
||||||
(void)taosThreadRwlockUnlock(&pData->lock);
|
(void)taosThreadRwlockUnlock(&pData->lock);
|
||||||
|
|
||||||
(void)taosThreadRwlockDestroy(&pData->lock);
|
(void)taosThreadRwlockDestroy(&pData->lock);
|
||||||
|
|
||||||
|
dDebug("begin to lock status info when thread exit");
|
||||||
|
if (taosThreadMutexLock(&pData->statusInfolock) != 0) {
|
||||||
|
dError("failed to lock status info lock");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tsVinfo.pVloads != NULL) {
|
||||||
|
taosArrayDestroy(tsVinfo.pVloads);
|
||||||
|
tsVinfo.pVloads = NULL;
|
||||||
|
}
|
||||||
|
if (taosThreadMutexUnlock(&pData->statusInfolock) != 0) {
|
||||||
|
dError("failed to unlock status info lock");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
taosThreadMutexDestroy(&pData->statusInfolock);
|
||||||
|
memset(&pData->statusInfolock, 0, sizeof(pData->statusInfolock));
|
||||||
|
|
||||||
(void)taosThreadMutexDestroy(&pDnode->mutex);
|
(void)taosThreadMutexDestroy(&pDnode->mutex);
|
||||||
memset(&pDnode->mutex, 0, sizeof(pDnode->mutex));
|
memset(&pDnode->mutex, 0, sizeof(pDnode->mutex));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue