提交 20e77861 编写于 作者: S Shengliang Guan

Merge remote-tracking branch 'haoyifan/fix2' into develop

...@@ -84,7 +84,7 @@ static void dnodeAllocModules() { ...@@ -84,7 +84,7 @@ static void dnodeAllocModules() {
} }
void dnodeCleanupModules() { void dnodeCleanupModules() {
for (int32_t module = 1; module < TSDB_MOD_MAX; ++module) { for (EModuleType module = 1; module < TSDB_MOD_MAX; ++module) {
if (tsModule[module].enable && tsModule[module].stopFp) { if (tsModule[module].enable && tsModule[module].stopFp) {
(*tsModule[module].stopFp)(); (*tsModule[module].stopFp)();
} }
......
...@@ -136,17 +136,24 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) { ...@@ -136,17 +136,24 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) {
taosAddIntoQset(pWorker->qset, queue, pVnode); taosAddIntoQset(pWorker->qset, queue, pVnode);
pWorker->qall = taosAllocateQall(); pWorker->qall = taosAllocateQall();
wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max; if (pWorker->qall == NULL) {
taosCloseQset(pWorker->qset);
taosCloseQueue(queue);
return NULL;
}
pthread_attr_t thAttr; pthread_attr_t thAttr;
pthread_attr_init(&thAttr); pthread_attr_init(&thAttr);
pthread_attr_setdetachstate(&thAttr, PTHREAD_CREATE_JOINABLE); pthread_attr_setdetachstate(&thAttr, PTHREAD_CREATE_JOINABLE);
if (pthread_create(&pWorker->thread, &thAttr, dnodeProcessWriteQueue, pWorker) != 0) { if (pthread_create(&pWorker->thread, &thAttr, dnodeProcessWriteQueue, pWorker) != 0) {
dError("failed to create thread to process read queue, reason:%s", strerror(errno)); dError("failed to create thread to process read queue, reason:%s", strerror(errno));
taosFreeQall(pWorker->qall);
taosCloseQset(pWorker->qset); taosCloseQset(pWorker->qset);
taosCloseQueue(queue);
queue = NULL;
} else { } else {
dTrace("write worker:%d is launched", pWorker->workerId); dTrace("write worker:%d is launched", pWorker->workerId);
wWorkerPool.nextId = (wWorkerPool.nextId + 1) % wWorkerPool.max;
} }
pthread_attr_destroy(&thAttr); pthread_attr_destroy(&thAttr);
...@@ -195,7 +202,7 @@ static void *dnodeProcessWriteQueue(void *param) { ...@@ -195,7 +202,7 @@ static void *dnodeProcessWriteQueue(void *param) {
while (1) { while (1) {
numOfMsgs = taosReadAllQitemsFromQset(pWorker->qset, pWorker->qall, &pVnode); numOfMsgs = taosReadAllQitemsFromQset(pWorker->qset, pWorker->qall, &pVnode);
if (numOfMsgs ==0) { if (numOfMsgs == 0) {
dTrace("dnodeProcessWriteQueee: got no message from qset, exiting..."); dTrace("dnodeProcessWriteQueee: got no message from qset, exiting...");
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册