refactor return error
This commit is contained in:
parent
235712b79e
commit
7779c8a75e
|
@ -41,7 +41,7 @@ static void dmMayShouldUpdateIpWhiteList(SDnodeMgmt *pMgmt, int64_t ver) {
|
||||||
if (pMgmt->pData->ipWhiteVer == ver) {
|
if (pMgmt->pData->ipWhiteVer == ver) {
|
||||||
if (ver == 0) {
|
if (ver == 0) {
|
||||||
dDebug("disable ip-white-list on dnode ver: %" PRId64 ", status ver: %" PRId64 "", pMgmt->pData->ipWhiteVer, ver);
|
dDebug("disable ip-white-list on dnode ver: %" PRId64 ", status ver: %" PRId64 "", pMgmt->pData->ipWhiteVer, ver);
|
||||||
rpcSetIpWhite(pMgmt->msgCb.serverRpc, NULL);
|
(void)rpcSetIpWhite(pMgmt->msgCb.serverRpc, NULL);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
||||||
dGInfo("dnode:%d, set to dropped since not exist in mnode, statusSeq:%d", pMgmt->pData->dnodeId,
|
dGInfo("dnode:%d, set to dropped since not exist in mnode, statusSeq:%d", pMgmt->pData->dnodeId,
|
||||||
pMgmt->statusSeq);
|
pMgmt->statusSeq);
|
||||||
pMgmt->pData->dropped = 1;
|
pMgmt->pData->dropped = 1;
|
||||||
dmWriteEps(pMgmt->pData);
|
(void)dmWriteEps(pMgmt->pData);
|
||||||
dInfo("dnode will exit since it is in the dropped state");
|
dInfo("dnode will exit since it is in the dropped state");
|
||||||
(void)raise(SIGINT);
|
(void)raise(SIGINT);
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void *pHead = rpcMallocCont(contLen);
|
void *pHead = rpcMallocCont(contLen);
|
||||||
tSerializeSStatusReq(pHead, contLen, &req);
|
contLen = tSerializeSStatusReq(pHead, contLen, &req);
|
||||||
if (contLen < 0) {
|
if (contLen < 0) {
|
||||||
rpcFreeCont(pHead);
|
rpcFreeCont(pHead);
|
||||||
dError("failed to serialize status req since %s", tstrerror(contLen));
|
dError("failed to serialize status req since %s", tstrerror(contLen));
|
||||||
|
@ -226,7 +226,7 @@ void dmSendNotifyReq(SDnodeMgmt *pMgmt, SNotifyReq *pReq) {
|
||||||
|
|
||||||
SEpSet epSet = {0};
|
SEpSet epSet = {0};
|
||||||
dmGetMnodeEpSet(pMgmt->pData, &epSet);
|
dmGetMnodeEpSet(pMgmt->pData, &epSet);
|
||||||
rpcSendRequest(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, NULL);
|
(void)rpcSendRequest(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t dmProcessAuthRsp(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
int32_t dmProcessAuthRsp(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
||||||
|
|
|
@ -340,7 +340,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
|
||||||
if (vnodeCreate(path, &vnodeCfg, diskPrimary, pMgmt->pTfs) < 0) {
|
if (vnodeCreate(path, &vnodeCfg, diskPrimary, pMgmt->pTfs) < 0) {
|
||||||
dError("vgId:%d, failed to create vnode since %s", req.vgId, terrstr());
|
dError("vgId:%d, failed to create vnode since %s", req.vgId, terrstr());
|
||||||
vmReleaseVnode(pMgmt, pVnode);
|
vmReleaseVnode(pMgmt, pVnode);
|
||||||
tFreeSCreateVnodeReq(&req);
|
(void)tFreeSCreateVnodeReq(&req);
|
||||||
code = terrno != 0 ? terrno : -1;
|
code = terrno != 0 ? terrno : -1;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,7 +361,7 @@ void dmProcessServerStartupStatus(SDnode *pDnode, SRpcMsg *pMsg) {
|
||||||
} else {
|
} else {
|
||||||
rsp.pCont = rpcMallocCont(contLen);
|
rsp.pCont = rpcMallocCont(contLen);
|
||||||
if (rsp.pCont != NULL) {
|
if (rsp.pCont != NULL) {
|
||||||
tSerializeSServerStatusRsp(rsp.pCont, contLen, &statusRsp);
|
(void)tSerializeSServerStatusRsp(rsp.pCont, contLen, &statusRsp);
|
||||||
rsp.contLen = contLen;
|
rsp.contLen = contLen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,7 +246,7 @@ _OVER:
|
||||||
if (pWrapper != NULL) {
|
if (pWrapper != NULL) {
|
||||||
dmSendRsp(&rsp);
|
dmSendRsp(&rsp);
|
||||||
} else {
|
} else {
|
||||||
rpcSendResponse(&rsp);
|
(void)rpcSendResponse(&rsp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ int32_t dmCheckRunning(const char *dataDir, TdFilePtr *pFile) {
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
code = TAOS_SYSTEM_ERROR(errno);
|
||||||
taosCloseFile(pFile);
|
(void)taosCloseFile(pFile);
|
||||||
*pFile = NULL;
|
*pFile = NULL;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ static int32_t dmWriteCheckCodeFile(char *file, char *realfile, char *key, bool
|
||||||
opts.source = DM_KEY_INDICATOR;
|
opts.source = DM_KEY_INDICATOR;
|
||||||
opts.result = result;
|
opts.result = result;
|
||||||
opts.unitLen = 16;
|
opts.unitLen = 16;
|
||||||
CBC_Encrypt(&opts);
|
(void)CBC_Encrypt(&opts);
|
||||||
|
|
||||||
pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH);
|
pFile = taosOpenFile(file, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_TRUNC | TD_FILE_WRITE_THROUGH);
|
||||||
if (pFile == NULL) {
|
if (pFile == NULL) {
|
||||||
|
@ -359,7 +359,7 @@ static int32_t dmCompareEncryptKey(char *file, char *key, bool toLogFile) {
|
||||||
opts.source = content;
|
opts.source = content;
|
||||||
opts.result = result;
|
opts.result = result;
|
||||||
opts.unitLen = 16;
|
opts.unitLen = 16;
|
||||||
CBC_Decrypt(&opts);
|
(void)CBC_Decrypt(&opts);
|
||||||
|
|
||||||
if (strcmp(opts.result, DM_KEY_INDICATOR) != 0) {
|
if (strcmp(opts.result, DM_KEY_INDICATOR) != 0) {
|
||||||
code = TSDB_CODE_DNODE_ENCRYPTKEY_CHANGED;
|
code = TSDB_CODE_DNODE_ENCRYPTKEY_CHANGED;
|
||||||
|
|
|
@ -57,8 +57,8 @@ void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool need
|
||||||
void dmGetMonitorSystemInfo(SMonSysInfo *pInfo) {
|
void dmGetMonitorSystemInfo(SMonSysInfo *pInfo) {
|
||||||
taosGetCpuUsage(&pInfo->cpu_system, &pInfo->cpu_engine);
|
taosGetCpuUsage(&pInfo->cpu_system, &pInfo->cpu_engine);
|
||||||
taosGetCpuCores(&pInfo->cpu_cores, false);
|
taosGetCpuCores(&pInfo->cpu_cores, false);
|
||||||
taosGetProcMemory(&pInfo->mem_engine);
|
(void)taosGetProcMemory(&pInfo->mem_engine);
|
||||||
taosGetSysMemory(&pInfo->mem_system);
|
(void)taosGetSysMemory(&pInfo->mem_system);
|
||||||
pInfo->mem_total = tsTotalMemoryKB;
|
pInfo->mem_total = tsTotalMemoryKB;
|
||||||
pInfo->disk_engine = 0;
|
pInfo->disk_engine = 0;
|
||||||
pInfo->disk_used = tsDataSpace.size.used;
|
pInfo->disk_used = tsDataSpace.size.used;
|
||||||
|
|
|
@ -50,10 +50,10 @@ int32_t streamTaskSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTa
|
||||||
}
|
}
|
||||||
|
|
||||||
STablePair pair1 = {.tbl = pTq->pStreamMeta->pTaskDb, .type = SNAP_DATA_STREAM_TASK};
|
STablePair pair1 = {.tbl = pTq->pStreamMeta->pTaskDb, .type = SNAP_DATA_STREAM_TASK};
|
||||||
taosArrayPush(pReader->tdbTbList, &pair1);
|
(void)taosArrayPush(pReader->tdbTbList, &pair1);
|
||||||
|
|
||||||
STablePair pair2 = {.tbl = pTq->pStreamMeta->pCheckpointDb, .type = SNAP_DATA_STREAM_TASK_CHECKPOINT};
|
STablePair pair2 = {.tbl = pTq->pStreamMeta->pCheckpointDb, .type = SNAP_DATA_STREAM_TASK_CHECKPOINT};
|
||||||
taosArrayPush(pReader->tdbTbList, &pair2);
|
(void)taosArrayPush(pReader->tdbTbList, &pair2);
|
||||||
|
|
||||||
pReader->pos = 0;
|
pReader->pos = 0;
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ int32_t streamTaskSnapReaderOpen(STQ* pTq, int64_t sver, int64_t ever, SStreamTa
|
||||||
|
|
||||||
_err:
|
_err:
|
||||||
tqError("vgId:%d, vnode stream-task snapshot reader open failed since %s", TD_VID(pTq->pVnode), tstrerror(code));
|
tqError("vgId:%d, vnode stream-task snapshot reader open failed since %s", TD_VID(pTq->pVnode), tstrerror(code));
|
||||||
streamTaskSnapReaderClose(pReader);
|
(void)streamTaskSnapReaderClose(pReader);
|
||||||
*ppReader = NULL;
|
*ppReader = NULL;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ int32_t streamTaskSnapReaderClose(SStreamTaskReader* pReader) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
tqInfo("vgId:%d, vnode stream-task snapshot reader closed", TD_VID(pReader->pTq->pVnode));
|
tqInfo("vgId:%d, vnode stream-task snapshot reader closed", TD_VID(pReader->pTq->pVnode));
|
||||||
taosArrayDestroy(pReader->tdbTbList);
|
taosArrayDestroy(pReader->tdbTbList);
|
||||||
tdbTbcClose(pReader->pCur);
|
(void)tdbTbcClose(pReader->pCur);
|
||||||
taosMemoryFree(pReader);
|
taosMemoryFree(pReader);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -126,17 +126,17 @@ NextTbl:
|
||||||
memcpy(pVal, tVal, tLen);
|
memcpy(pVal, tVal, tLen);
|
||||||
vLen = tLen;
|
vLen = tLen;
|
||||||
}
|
}
|
||||||
tdbTbcMoveToNext(pReader->pCur);
|
(void)tdbTbcMoveToNext(pReader->pCur);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (except == 1) {
|
if (except == 1) {
|
||||||
if (pReader->pos + 1 < taosArrayGetSize(pReader->tdbTbList)) {
|
if (pReader->pos + 1 < taosArrayGetSize(pReader->tdbTbList)) {
|
||||||
tdbTbcClose(pReader->pCur);
|
(void)tdbTbcClose(pReader->pCur);
|
||||||
|
|
||||||
pReader->pos += 1;
|
pReader->pos += 1;
|
||||||
pPair = taosArrayGet(pReader->tdbTbList, pReader->pos);
|
pPair = taosArrayGet(pReader->tdbTbList, pReader->pos);
|
||||||
code = tdbTbcOpen(pPair->tbl, &pReader->pCur, NULL);
|
code = tdbTbcOpen(pPair->tbl, &pReader->pCur, NULL);
|
||||||
tdbTbcMoveToFirst(pReader->pCur);
|
(void)tdbTbcMoveToFirst(pReader->pCur);
|
||||||
|
|
||||||
goto NextTbl;
|
goto NextTbl;
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ int32_t streamTaskSnapWriterClose(SStreamTaskWriter* pWriter, int8_t rollback) {
|
||||||
streamMetaWLock(pTq->pStreamMeta);
|
streamMetaWLock(pTq->pStreamMeta);
|
||||||
tqDebug("vgId:%d, vnode stream-task snapshot writer closed", TD_VID(pTq->pVnode));
|
tqDebug("vgId:%d, vnode stream-task snapshot writer closed", TD_VID(pTq->pVnode));
|
||||||
if (rollback) {
|
if (rollback) {
|
||||||
tdbAbort(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
(void)tdbAbort(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
||||||
} else {
|
} else {
|
||||||
code = tdbCommit(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
code = tdbCommit(pTq->pStreamMeta->db, pTq->pStreamMeta->txn);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
|
@ -258,7 +258,7 @@ int32_t indexSearch(SIndex* index, SIndexMultiTermQuery* multiQuerys, SArray* re
|
||||||
(void)idxTermSearch(index, qterm, &trslt);
|
(void)idxTermSearch(index, qterm, &trslt);
|
||||||
(void)taosArrayPush(iRslts, (void*)&trslt);
|
(void)taosArrayPush(iRslts, (void*)&trslt);
|
||||||
}
|
}
|
||||||
idxMergeFinalResults(iRslts, opera, result);
|
(void)idxMergeFinalResults(iRslts, opera, result);
|
||||||
idxInterRsltDestroy(iRslts);
|
idxInterRsltDestroy(iRslts);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -390,10 +390,10 @@ void idxCacheDebug(IndexCache* cache) {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
taosThreadMutexLock(&cache->mtx);
|
(void)taosThreadMutexLock(&cache->mtx);
|
||||||
tbl = cache->imm;
|
tbl = cache->imm;
|
||||||
idxMemRef(tbl);
|
idxMemRef(tbl);
|
||||||
taosThreadMutexUnlock(&cache->mtx);
|
(void)taosThreadMutexUnlock(&cache->mtx);
|
||||||
if (tbl != NULL) {
|
if (tbl != NULL) {
|
||||||
SSkipList* slt = tbl->mem;
|
SSkipList* slt = tbl->mem;
|
||||||
SSkipListIterator* iter = tSkipListCreateIter(slt);
|
SSkipListIterator* iter = tSkipListCreateIter(slt);
|
||||||
|
@ -438,7 +438,7 @@ void idxCacheDestroyImm(IndexCache* cache) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MemTable* tbl = NULL;
|
MemTable* tbl = NULL;
|
||||||
taosThreadMutexLock(&cache->mtx);
|
(void)taosThreadMutexLock(&cache->mtx);
|
||||||
|
|
||||||
tbl = cache->imm;
|
tbl = cache->imm;
|
||||||
cache->imm = NULL; // or throw int bg thread
|
cache->imm = NULL; // or throw int bg thread
|
||||||
|
@ -533,7 +533,7 @@ static void idxCacheMakeRoomForWrite(IndexCache* cache) {
|
||||||
}
|
}
|
||||||
// 1. sched to merge
|
// 1. sched to merge
|
||||||
// 2. unref cache in bgwork
|
// 2. unref cache in bgwork
|
||||||
idxCacheSchedToMerge(cache, quit);
|
(void)idxCacheSchedToMerge(cache, quit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,7 +285,7 @@ void fstStateCompileForAnyTrans(IdxFstFile* w, CompiledAddr addr, FstBuilderNode
|
||||||
}
|
}
|
||||||
for (int32_t i = sz - 1; i >= 0; i--) {
|
for (int32_t i = sz - 1; i >= 0; i--) {
|
||||||
FstTransition* t = taosArrayGet(node->trans, i);
|
FstTransition* t = taosArrayGet(node->trans, i);
|
||||||
idxFileWrite(w, (char*)&t->inp, 1);
|
(void)idxFileWrite(w, (char*)&t->inp, 1);
|
||||||
}
|
}
|
||||||
if (sz > TRANS_INDEX_THRESHOLD) {
|
if (sz > TRANS_INDEX_THRESHOLD) {
|
||||||
// A value of 255 indicates that no transition exists for the byte at that idx
|
// A value of 255 indicates that no transition exists for the byte at that idx
|
||||||
|
@ -1015,7 +1015,7 @@ void fstDestroy(Fst* fst) {
|
||||||
taosMemoryFree(fst->meta);
|
taosMemoryFree(fst->meta);
|
||||||
fstSliceDestroy(fst->data);
|
fstSliceDestroy(fst->data);
|
||||||
taosMemoryFree(fst->data);
|
taosMemoryFree(fst->data);
|
||||||
taosThreadMutexDestroy(&fst->mtx);
|
(void)taosThreadMutexDestroy(&fst->mtx);
|
||||||
}
|
}
|
||||||
taosMemoryFree(fst);
|
taosMemoryFree(fst);
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,7 @@ IdxFstFile* idxFileCreate(void* wrt) {
|
||||||
return cw;
|
return cw;
|
||||||
}
|
}
|
||||||
void idxFileDestroy(IdxFstFile* cw) {
|
void idxFileDestroy(IdxFstFile* cw) {
|
||||||
idxFileFlush(cw);
|
(void)idxFileFlush(cw);
|
||||||
taosMemoryFree(cw);
|
taosMemoryFree(cw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ uint32_t idxFileMaskedCheckSum(IdxFstFile* write) {
|
||||||
|
|
||||||
int idxFileFlush(IdxFstFile* write) {
|
int idxFileFlush(IdxFstFile* write) {
|
||||||
IFileCtx* ctx = write->wrt;
|
IFileCtx* ctx = write->wrt;
|
||||||
ctx->flush(ctx);
|
(void)(ctx->flush(ctx));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ void idxFilePackUintIn(IdxFstFile* writer, uint64_t n, uint8_t nBytes) {
|
||||||
buf[i] = (uint8_t)n;
|
buf[i] = (uint8_t)n;
|
||||||
n = n >> 8;
|
n = n >> 8;
|
||||||
}
|
}
|
||||||
idxFileWrite(writer, buf, nBytes);
|
(void)idxFileWrite(writer, buf, nBytes);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -671,7 +671,7 @@ IndexTFile* idxTFileCreate(SIndex* idx, const char* path) {
|
||||||
tfileCacheDestroy(cache);
|
tfileCacheDestroy(cache);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
taosThreadMutexInit(&tfile->mtx, NULL);
|
(void)taosThreadMutexInit(&tfile->mtx, NULL);
|
||||||
tfile->cache = cache;
|
tfile->cache = cache;
|
||||||
return tfile;
|
return tfile;
|
||||||
}
|
}
|
||||||
|
|
|
@ -646,7 +646,7 @@ static SCliConn* getConnFromPool(SCliThrd* pThrd, char* key, bool* exceed) {
|
||||||
SConnList* plist = taosHashGet((SHashObj*)pool, key, klen);
|
SConnList* plist = taosHashGet((SHashObj*)pool, key, klen);
|
||||||
if (plist == NULL) {
|
if (plist == NULL) {
|
||||||
SConnList list = {0};
|
SConnList list = {0};
|
||||||
taosHashPut((SHashObj*)pool, key, klen, (void*)&list, sizeof(list));
|
(void)taosHashPut((SHashObj*)pool, key, klen, (void*)&list, sizeof(list));
|
||||||
plist = taosHashGet(pool, key, klen);
|
plist = taosHashGet(pool, key, klen);
|
||||||
|
|
||||||
SMsgList* nList = taosMemoryCalloc(1, sizeof(SMsgList));
|
SMsgList* nList = taosMemoryCalloc(1, sizeof(SMsgList));
|
||||||
|
@ -903,7 +903,7 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) {
|
||||||
conn->refId = exh->refId;
|
conn->refId = exh->refId;
|
||||||
taosWUnLockLatch(&exh->latch);
|
taosWUnLockLatch(&exh->latch);
|
||||||
|
|
||||||
transReleaseExHandle(transGetRefMgt(), handle);
|
(void)transReleaseExHandle(transGetRefMgt(), handle);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1010,7 +1010,7 @@ _failed:
|
||||||
if (conn) {
|
if (conn) {
|
||||||
taosMemoryFree(conn->stream);
|
taosMemoryFree(conn->stream);
|
||||||
transReqQueueClear(&conn->wreqQueue);
|
transReqQueueClear(&conn->wreqQueue);
|
||||||
transDestroyBuffer(&conn->readBuf);
|
(void)transDestroyBuffer(&conn->readBuf);
|
||||||
transQueueDestroy(&conn->cliMsgs);
|
transQueueDestroy(&conn->cliMsgs);
|
||||||
}
|
}
|
||||||
taosMemoryFree(conn);
|
taosMemoryFree(conn);
|
||||||
|
@ -1390,7 +1390,7 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
|
||||||
cliHandleFastFail(conn, -1);
|
cliHandleFastFail(conn, -1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uv_timer_start(conn->timer, cliConnTimeout, TRANS_CONN_TIMEOUT, 0);
|
(void)uv_timer_start(conn->timer, cliConnTimeout, TRANS_CONN_TIMEOUT, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1481,9 +1481,9 @@ void cliConnCb(uv_connect_t* req, int status) {
|
||||||
if (pConn->timer == NULL) {
|
if (pConn->timer == NULL) {
|
||||||
timeout = true;
|
timeout = true;
|
||||||
} else {
|
} else {
|
||||||
uv_timer_stop(pConn->timer);
|
(void)uv_timer_stop(pConn->timer);
|
||||||
pConn->timer->data = NULL;
|
pConn->timer->data = NULL;
|
||||||
taosArrayPush(pThrd->timerList, &pConn->timer);
|
(void)taosArrayPush(pThrd->timerList, &pConn->timer);
|
||||||
pConn->timer = NULL;
|
pConn->timer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1609,7 +1609,7 @@ SCliConn* cliGetConn(SCliMsg** pMsg, SCliThrd* pThrd, bool* ignore, char* addr)
|
||||||
conn = getConnFromPool2(pThrd, addr, pMsg);
|
conn = getConnFromPool2(pThrd, addr, pMsg);
|
||||||
if (conn != NULL) specifyConnRef(conn, true, refId);
|
if (conn != NULL) specifyConnRef(conn, true, refId);
|
||||||
}
|
}
|
||||||
transReleaseExHandle(transGetRefMgt(), refId);
|
(void)transReleaseExHandle(transGetRefMgt(), refId);
|
||||||
}
|
}
|
||||||
return conn;
|
return conn;
|
||||||
};
|
};
|
||||||
|
@ -1759,14 +1759,14 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
|
||||||
|
|
||||||
if (conn != NULL) {
|
if (conn != NULL) {
|
||||||
transCtxMerge(&conn->ctx, &pMsg->ctx->appCtx);
|
transCtxMerge(&conn->ctx, &pMsg->ctx->appCtx);
|
||||||
transQueuePush(&conn->cliMsgs, pMsg);
|
(void)transQueuePush(&conn->cliMsgs, pMsg);
|
||||||
cliSend(conn);
|
cliSend(conn);
|
||||||
} else {
|
} else {
|
||||||
code = cliCreateConn(pThrd, &conn);
|
code = cliCreateConn(pThrd, &conn);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
tError("%s failed to create conn, reason:%s", pTransInst->label, tstrerror(code));
|
tError("%s failed to create conn, reason:%s", pTransInst->label, tstrerror(code));
|
||||||
STransMsg resp = {.code = code};
|
STransMsg resp = {.code = code};
|
||||||
cliBuildExceptResp(pMsg, &resp);
|
(void)cliBuildExceptResp(pMsg, &resp);
|
||||||
|
|
||||||
resp.info.cliVer = pTransInst->compatibilityVer;
|
resp.info.cliVer = pTransInst->compatibilityVer;
|
||||||
if (pMsg->type != Release) {
|
if (pMsg->type != Release) {
|
||||||
|
@ -1827,7 +1827,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
|
||||||
|
|
||||||
ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
|
ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
uv_timer_stop(conn->timer);
|
(void)uv_timer_stop(conn->timer);
|
||||||
conn->timer->data = NULL;
|
conn->timer->data = NULL;
|
||||||
(void)taosArrayPush(pThrd->timerList, &conn->timer);
|
(void)taosArrayPush(pThrd->timerList, &conn->timer);
|
||||||
conn->timer = NULL;
|
conn->timer = NULL;
|
||||||
|
@ -1923,7 +1923,7 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) {
|
||||||
|
|
||||||
QUEUE_PUSH(&pBatchList->wq, &pBatch->listq);
|
QUEUE_PUSH(&pBatchList->wq, &pBatch->listq);
|
||||||
|
|
||||||
taosHashPut(pThrd->batchCache, key, klen, &pBatchList, sizeof(void*));
|
(void)taosHashPut(pThrd->batchCache, key, klen, &pBatchList, sizeof(void*));
|
||||||
} else {
|
} else {
|
||||||
if (QUEUE_IS_EMPTY(&(*ppBatchList)->wq)) {
|
if (QUEUE_IS_EMPTY(&(*ppBatchList)->wq)) {
|
||||||
SCliBatch* pBatch = taosMemoryCalloc(1, sizeof(SCliBatch));
|
SCliBatch* pBatch = taosMemoryCalloc(1, sizeof(SCliBatch));
|
||||||
|
@ -2099,10 +2099,10 @@ static void* cliWorkThread(void* arg) {
|
||||||
SCliThrd* pThrd = (SCliThrd*)arg;
|
SCliThrd* pThrd = (SCliThrd*)arg;
|
||||||
pThrd->pid = taosGetSelfPthreadId();
|
pThrd->pid = taosGetSelfPthreadId();
|
||||||
|
|
||||||
strtolower(threadName, pThrd->pTransInst->label);
|
(void)strtolower(threadName, pThrd->pTransInst->label);
|
||||||
setThreadName(threadName);
|
setThreadName(threadName);
|
||||||
|
|
||||||
uv_run(pThrd->loop, UV_RUN_DEFAULT);
|
(void)uv_run(pThrd->loop, UV_RUN_DEFAULT);
|
||||||
|
|
||||||
tDebug("thread quit-thread:%08" PRId64, pThrd->pid);
|
tDebug("thread quit-thread:%08" PRId64, pThrd->pid);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2198,7 +2198,7 @@ static int32_t createThrdObj(void* trans, SCliThrd** ppThrd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QUEUE_INIT(&pThrd->msg);
|
QUEUE_INIT(&pThrd->msg);
|
||||||
taosThreadMutexInit(&pThrd->msgMtx, NULL);
|
(void)taosThreadMutexInit(&pThrd->msgMtx, NULL);
|
||||||
|
|
||||||
pThrd->loop = (uv_loop_t*)taosMemoryMalloc(sizeof(uv_loop_t));
|
pThrd->loop = (uv_loop_t*)taosMemoryMalloc(sizeof(uv_loop_t));
|
||||||
if (pThrd->loop == NULL) {
|
if (pThrd->loop == NULL) {
|
||||||
|
@ -2291,7 +2291,7 @@ _end:
|
||||||
(void)uv_loop_close(pThrd->loop);
|
(void)uv_loop_close(pThrd->loop);
|
||||||
taosMemoryFree(pThrd->loop);
|
taosMemoryFree(pThrd->loop);
|
||||||
taosMemoryFree(pThrd->prepare);
|
taosMemoryFree(pThrd->prepare);
|
||||||
taosThreadMutexDestroy(&pThrd->msgMtx);
|
(void)taosThreadMutexDestroy(&pThrd->msgMtx);
|
||||||
transAsyncPoolDestroy(pThrd->asyncPool);
|
transAsyncPoolDestroy(pThrd->asyncPool);
|
||||||
for (int i = 0; i < taosArrayGetSize(pThrd->timerList); i++) {
|
for (int i = 0; i < taosArrayGetSize(pThrd->timerList); i++) {
|
||||||
uv_timer_t* timer = taosArrayGetP(pThrd->timerList, i);
|
uv_timer_t* timer = taosArrayGetP(pThrd->timerList, i);
|
||||||
|
@ -2916,7 +2916,7 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs
|
||||||
|
|
||||||
STransConnCtx* pCtx = taosMemoryCalloc(1, sizeof(STransConnCtx));
|
STransConnCtx* pCtx = taosMemoryCalloc(1, sizeof(STransConnCtx));
|
||||||
if (pCtx == NULL) {
|
if (pCtx == NULL) {
|
||||||
tsem_destroy(sem);
|
(void)tsem_destroy(sem);
|
||||||
taosMemoryFree(sem);
|
taosMemoryFree(sem);
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _RETURN1);
|
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _RETURN1);
|
||||||
}
|
}
|
||||||
|
@ -2930,7 +2930,7 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs
|
||||||
|
|
||||||
SCliMsg* cliMsg = taosMemoryCalloc(1, sizeof(SCliMsg));
|
SCliMsg* cliMsg = taosMemoryCalloc(1, sizeof(SCliMsg));
|
||||||
if (cliMsg == NULL) {
|
if (cliMsg == NULL) {
|
||||||
tsem_destroy(sem);
|
(void)tsem_destroy(sem);
|
||||||
taosMemoryFree(sem);
|
taosMemoryFree(sem);
|
||||||
taosMemoryFree(pCtx);
|
taosMemoryFree(pCtx);
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _RETURN1);
|
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _RETURN1);
|
||||||
|
@ -2951,7 +2951,7 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs
|
||||||
destroyCmsg(cliMsg);
|
destroyCmsg(cliMsg);
|
||||||
TAOS_CHECK_GOTO((code == TSDB_CODE_RPC_ASYNC_MODULE_QUIT ? TSDB_CODE_RPC_MODULE_QUIT : code), NULL, _RETURN);
|
TAOS_CHECK_GOTO((code == TSDB_CODE_RPC_ASYNC_MODULE_QUIT ? TSDB_CODE_RPC_MODULE_QUIT : code), NULL, _RETURN);
|
||||||
}
|
}
|
||||||
tsem_wait(sem);
|
(void)tsem_wait(sem);
|
||||||
|
|
||||||
memcpy(pRsp, pTransRsp, sizeof(STransMsg));
|
memcpy(pRsp, pTransRsp, sizeof(STransMsg));
|
||||||
|
|
||||||
|
@ -3085,7 +3085,7 @@ int transSendRecvWithTimeout(void* shandle, SEpSet* pEpSet, STransMsg* pReq, STr
|
||||||
_RETURN:
|
_RETURN:
|
||||||
(void)transReleaseExHandle(transGetInstMgt(), (int64_t)shandle);
|
(void)transReleaseExHandle(transGetInstMgt(), (int64_t)shandle);
|
||||||
(void)taosReleaseRef(transGetSyncMsgMgt(), ref);
|
(void)taosReleaseRef(transGetSyncMsgMgt(), ref);
|
||||||
taosRemoveRef(transGetSyncMsgMgt(), ref);
|
(void)taosRemoveRef(transGetSyncMsgMgt(), ref);
|
||||||
return code;
|
return code;
|
||||||
_RETURN2:
|
_RETURN2:
|
||||||
transFreeMsg(pReq->pCont);
|
transFreeMsg(pReq->pCont);
|
||||||
|
|
|
@ -377,7 +377,7 @@ void transCtxMerge(STransCtx* dst, STransCtx* src) {
|
||||||
// if (dVal) {
|
// if (dVal) {
|
||||||
// dst->freeFunc(dVal->val);
|
// dst->freeFunc(dVal->val);
|
||||||
// }
|
// }
|
||||||
taosHashPut(dst->args, key, klen, sVal, sizeof(*sVal));
|
(void)taosHashPut(dst->args, key, klen, sVal, sizeof(*sVal));
|
||||||
iter = taosHashIterate(src->args, iter);
|
iter = taosHashIterate(src->args, iter);
|
||||||
}
|
}
|
||||||
taosHashCleanup(src->args);
|
taosHashCleanup(src->args);
|
||||||
|
|
|
@ -1673,7 +1673,7 @@ void transCloseServer(void* arg) {
|
||||||
destroyWorkThrd(srv->pThreadObj[i]);
|
destroyWorkThrd(srv->pThreadObj[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uv_loop_close(srv->loop);
|
(void)uv_loop_close(srv->loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(srv->pThreadObj);
|
taosMemoryFree(srv->pThreadObj);
|
||||||
|
|
|
@ -823,9 +823,9 @@ int32_t tsDecompressTimestampImp(const char *const input, const int32_t nelement
|
||||||
return nelements * longBytes;
|
return nelements * longBytes;
|
||||||
} else if (input[0] == 1) { // Decompress
|
} else if (input[0] == 1) { // Decompress
|
||||||
if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
|
if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
|
||||||
tsDecompressTimestampAvx512(input, nelements, output, false);
|
(void)tsDecompressTimestampAvx512(input, nelements, output, false);
|
||||||
} else if (tsSIMDEnable && tsAVX2Supported) {
|
} else if (tsSIMDEnable && tsAVX2Supported) {
|
||||||
tsDecompressTimestampAvx2(input, nelements, output, false);
|
(void)tsDecompressTimestampAvx2(input, nelements, output, false);
|
||||||
} else {
|
} else {
|
||||||
int64_t *ostream = (int64_t *)output;
|
int64_t *ostream = (int64_t *)output;
|
||||||
|
|
||||||
|
@ -1199,9 +1199,9 @@ int32_t tsDecompressFloatImp(const char *const input, const int32_t nelements, c
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsSIMDEnable && tsAVX2Supported) {
|
if (tsSIMDEnable && tsAVX2Supported) {
|
||||||
tsDecompressFloatImplAvx2(input, nelements, output);
|
(void)tsDecompressFloatImplAvx2(input, nelements, output);
|
||||||
} else if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
|
} else if (tsSIMDEnable && tsAVX512Supported && tsAVX512Enable) {
|
||||||
tsDecompressFloatImplAvx512(input, nelements, output);
|
(void)tsDecompressFloatImplAvx512(input, nelements, output);
|
||||||
} else { // alternative implementation without SIMD instructions.
|
} else { // alternative implementation without SIMD instructions.
|
||||||
tsDecompressFloatHelper(input, nelements, (float *)output);
|
tsDecompressFloatHelper(input, nelements, (float *)output);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue