enh:modify error code passing
This commit is contained in:
parent
288e9adebb
commit
3db73b7244
|
@ -547,7 +547,7 @@ int32_t streamTaskGetNumOfUpstream(const SStreamTask* pTask) { return taosArrayG
|
||||||
int32_t streamTaskSetUpstreamInfo(SStreamTask* pTask, const SStreamTask* pUpstreamTask) {
|
int32_t streamTaskSetUpstreamInfo(SStreamTask* pTask, const SStreamTask* pUpstreamTask) {
|
||||||
SStreamUpstreamEpInfo* pEpInfo = createStreamTaskEpInfo(pUpstreamTask);
|
SStreamUpstreamEpInfo* pEpInfo = createStreamTaskEpInfo(pUpstreamTask);
|
||||||
if (pEpInfo == NULL) {
|
if (pEpInfo == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pTask->upstreamInfo.pList == NULL) {
|
if (pTask->upstreamInfo.pList == NULL) {
|
||||||
|
|
|
@ -154,7 +154,7 @@ static int32_t taosCompressHttpRport(char* pSrc, int32_t srcLen) {
|
||||||
void* pDest = taosMemoryMalloc(destLen);
|
void* pDest = taosMemoryMalloc(destLen);
|
||||||
|
|
||||||
if (pDest == NULL) {
|
if (pDest == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ static int32_t httpCreateMsg(const char* server, const char* uri, uint16_t port,
|
||||||
SHttpMsg* msg = taosMemoryMalloc(sizeof(SHttpMsg));
|
SHttpMsg* msg = taosMemoryMalloc(sizeof(SHttpMsg));
|
||||||
if (msg == NULL) {
|
if (msg == NULL) {
|
||||||
*httpMsg = NULL;
|
*httpMsg = NULL;
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg->seq = seqNum;
|
msg->seq = seqNum;
|
||||||
|
@ -273,7 +273,7 @@ static int32_t httpCreateMsg(const char* server, const char* uri, uint16_t port,
|
||||||
if (msg->server == NULL || msg->uri == NULL || msg->cont == NULL) {
|
if (msg->server == NULL || msg->uri == NULL || msg->cont == NULL) {
|
||||||
httpDestroyMsg(msg);
|
httpDestroyMsg(msg);
|
||||||
*httpMsg = NULL;
|
*httpMsg = NULL;
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(msg->cont, pCont, contLen);
|
memcpy(msg->cont, pCont, contLen);
|
||||||
|
@ -585,7 +585,7 @@ static void httpHandleReq(SHttpMsg* msg) {
|
||||||
int32_t cap = 2048;
|
int32_t cap = 2048;
|
||||||
header = taosMemoryCalloc(1, cap);
|
header = taosMemoryCalloc(1, cap);
|
||||||
if (header == NULL) {
|
if (header == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ static void httpHandleReq(SHttpMsg* msg) {
|
||||||
|
|
||||||
uv_buf_t* wb = taosMemoryCalloc(2, sizeof(uv_buf_t));
|
uv_buf_t* wb = taosMemoryCalloc(2, sizeof(uv_buf_t));
|
||||||
if (wb == NULL) {
|
if (wb == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,7 +607,7 @@ static void httpHandleReq(SHttpMsg* msg) {
|
||||||
SHttpClient* cli = taosMemoryCalloc(1, sizeof(SHttpClient));
|
SHttpClient* cli = taosMemoryCalloc(1, sizeof(SHttpClient));
|
||||||
if (cli == NULL) {
|
if (cli == NULL) {
|
||||||
taosMemoryFree(wb);
|
taosMemoryFree(wb);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
cli->seq = msg->seq;
|
cli->seq = msg->seq;
|
||||||
|
@ -784,13 +784,13 @@ int64_t transInitHttpChanImpl() {
|
||||||
|
|
||||||
http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK);
|
http->connStatusTable = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_ENTRY_LOCK);
|
||||||
if (http->connStatusTable == NULL) {
|
if (http->connStatusTable == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _ERROR;
|
goto _ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
http->loop = taosMemoryMalloc(sizeof(uv_loop_t));
|
http->loop = taosMemoryMalloc(sizeof(uv_loop_t));
|
||||||
if (http->loop == NULL) {
|
if (http->loop == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto _ERROR;
|
goto _ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ void* rpcOpen(const SRpcInit* pInit) {
|
||||||
|
|
||||||
SRpcInfo* pRpc = taosMemoryCalloc(1, sizeof(SRpcInfo));
|
SRpcInfo* pRpc = taosMemoryCalloc(1, sizeof(SRpcInfo));
|
||||||
if (pRpc == NULL) {
|
if (pRpc == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
if (pInit->label) {
|
if (pInit->label) {
|
||||||
int len = strlen(pInit->label) > sizeof(pRpc->label) ? sizeof(pRpc->label) : strlen(pInit->label);
|
int len = strlen(pInit->label) > sizeof(pRpc->label) ? sizeof(pRpc->label) : strlen(pInit->label);
|
||||||
|
|
|
@ -984,7 +984,7 @@ static int32_t cliCreateConn(SCliThrd* pThrd, SCliConn** pCliConn) {
|
||||||
// read/write stream handle
|
// read/write stream handle
|
||||||
conn->stream = (uv_stream_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
conn->stream = (uv_stream_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
||||||
if (conn->stream == NULL) {
|
if (conn->stream == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TAOS_CHECK_GOTO(code, NULL, _failed);
|
TAOS_CHECK_GOTO(code, NULL, _failed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1167,7 +1167,7 @@ void cliSendBatch(SCliConn* pConn) {
|
||||||
|
|
||||||
uv_buf_t* wb = taosMemoryCalloc(wLen, sizeof(uv_buf_t));
|
uv_buf_t* wb = taosMemoryCalloc(wLen, sizeof(uv_buf_t));
|
||||||
if (wb == NULL) {
|
if (wb == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tError("%s conn %p failed to send batch msg since:%s", CONN_GET_INST_LABEL(pConn), pConn, tstrerror(code));
|
tError("%s conn %p failed to send batch msg since:%s", CONN_GET_INST_LABEL(pConn), pConn, tstrerror(code));
|
||||||
goto _exception;
|
goto _exception;
|
||||||
}
|
}
|
||||||
|
@ -1221,7 +1221,7 @@ void cliSendBatch(SCliConn* pConn) {
|
||||||
|
|
||||||
uv_write_t* req = taosMemoryCalloc(1, sizeof(uv_write_t));
|
uv_write_t* req = taosMemoryCalloc(1, sizeof(uv_write_t));
|
||||||
if (req == NULL) {
|
if (req == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tError("%s conn %p failed to send batch msg since:%s", CONN_GET_INST_LABEL(pConn), pConn, tstrerror(code));
|
tError("%s conn %p failed to send batch msg since:%s", CONN_GET_INST_LABEL(pConn), pConn, tstrerror(code));
|
||||||
goto _exception;
|
goto _exception;
|
||||||
}
|
}
|
||||||
|
@ -1971,7 +1971,7 @@ static int32_t createBatchList(SCliBatchList** ppBatchList, char* key, char* ip,
|
||||||
taosMemoryFree(pBatchList->dst);
|
taosMemoryFree(pBatchList->dst);
|
||||||
taosMemoryFree(pBatchList);
|
taosMemoryFree(pBatchList);
|
||||||
tError("failed to create batch list, reason:%s", tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
tError("failed to create batch list, reason:%s", tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
*ppBatchList = pBatchList;
|
*ppBatchList = pBatchList;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2205,7 +2205,7 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
SCliObj* cli = taosMemoryCalloc(1, sizeof(SCliObj));
|
SCliObj* cli = taosMemoryCalloc(1, sizeof(SCliObj));
|
||||||
if (cli == NULL) {
|
if (cli == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _err);
|
TAOS_CHECK_GOTO(terrno, NULL, _err);
|
||||||
}
|
}
|
||||||
|
|
||||||
STrans* pTransInst = shandle;
|
STrans* pTransInst = shandle;
|
||||||
|
@ -2214,7 +2214,7 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
|
|
||||||
cli->pThreadObj = (SCliThrd**)taosMemoryCalloc(cli->numOfThreads, sizeof(SCliThrd*));
|
cli->pThreadObj = (SCliThrd**)taosMemoryCalloc(cli->numOfThreads, sizeof(SCliThrd*));
|
||||||
if (cli->pThreadObj == NULL) {
|
if (cli->pThreadObj == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _err);
|
TAOS_CHECK_GOTO(terrno, NULL, _err);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < cli->numOfThreads; i++) {
|
for (int i = 0; i < cli->numOfThreads; i++) {
|
||||||
|
@ -2342,29 +2342,29 @@ static int32_t createThrdObj(void* trans, SCliThrd** ppThrd) {
|
||||||
pThrd->destroyAhandleFp = pTransInst->destroyFp;
|
pThrd->destroyAhandleFp = pTransInst->destroyFp;
|
||||||
pThrd->fqdn2ipCache = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
pThrd->fqdn2ipCache = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
if (pThrd->fqdn2ipCache == NULL) {
|
if (pThrd->fqdn2ipCache == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
pThrd->failFastCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
pThrd->failFastCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
if (pThrd->failFastCache == NULL) {
|
if (pThrd->failFastCache == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
pThrd->batchCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
pThrd->batchCache = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), true, HASH_NO_LOCK);
|
||||||
if (pThrd->batchCache == NULL) {
|
if (pThrd->batchCache == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t timerSize = 64;
|
int32_t timerSize = 64;
|
||||||
pThrd->timerList = taosArrayInit(timerSize, sizeof(void*));
|
pThrd->timerList = taosArrayInit(timerSize, sizeof(void*));
|
||||||
if (pThrd->timerList == NULL) {
|
if (pThrd->timerList == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < timerSize; i++) {
|
for (int i = 0; i < timerSize; i++) {
|
||||||
uv_timer_t* timer = taosMemoryCalloc(1, sizeof(uv_timer_t));
|
uv_timer_t* timer = taosMemoryCalloc(1, sizeof(uv_timer_t));
|
||||||
if (timer == NULL) {
|
if (timer == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
(void)uv_timer_init(pThrd->loop, timer);
|
(void)uv_timer_init(pThrd->loop, timer);
|
||||||
if (taosArrayPush(pThrd->timerList, &timer) == NULL) {
|
if (taosArrayPush(pThrd->timerList, &timer) == NULL) {
|
||||||
|
|
|
@ -128,7 +128,7 @@ int32_t transClearBuffer(SConnBuffer* buf) {
|
||||||
p->cap = BUFFER_CAP;
|
p->cap = BUFFER_CAP;
|
||||||
p->buf = taosMemoryRealloc(p->buf, BUFFER_CAP);
|
p->buf = taosMemoryRealloc(p->buf, BUFFER_CAP);
|
||||||
if (p->buf == NULL) {
|
if (p->buf == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p->left = -1;
|
p->left = -1;
|
||||||
|
@ -179,7 +179,7 @@ int32_t transResetBuffer(SConnBuffer* connBuf, int8_t resetBuf) {
|
||||||
p->cap = BUFFER_CAP;
|
p->cap = BUFFER_CAP;
|
||||||
p->buf = taosMemoryRealloc(p->buf, p->cap);
|
p->buf = taosMemoryRealloc(p->buf, p->cap);
|
||||||
if (p->buf == NULL) {
|
if (p->buf == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ int32_t transAllocBuffer(SConnBuffer* connBuf, uv_buf_t* uvBuf) {
|
||||||
if (p->buf == NULL) {
|
if (p->buf == NULL) {
|
||||||
uvBuf->base = NULL;
|
uvBuf->base = NULL;
|
||||||
uvBuf->len = 0;
|
uvBuf->len = 0;
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
uvBuf->base = p->buf + p->len;
|
uvBuf->base = p->buf + p->len;
|
||||||
uvBuf->len = p->left;
|
uvBuf->len = p->left;
|
||||||
|
@ -443,7 +443,7 @@ void transReqQueueClear(queue* q) {
|
||||||
int32_t transQueueInit(STransQueue* queue, void (*freeFunc)(const void* arg)) {
|
int32_t transQueueInit(STransQueue* queue, void (*freeFunc)(const void* arg)) {
|
||||||
queue->q = taosArrayInit(2, sizeof(void*));
|
queue->q = taosArrayInit(2, sizeof(void*));
|
||||||
if (queue->q == NULL) {
|
if (queue->q == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
queue->freeFunc = (void (*)(const void*))freeFunc;
|
queue->freeFunc = (void (*)(const void*))freeFunc;
|
||||||
|
|
||||||
|
@ -565,12 +565,12 @@ int32_t transDQCreate(uv_loop_t* loop, SDelayQueue** queue) {
|
||||||
|
|
||||||
heap = heapCreate(timeCompare);
|
heap = heapCreate(timeCompare);
|
||||||
if (heap == NULL) {
|
if (heap == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _return1);
|
TAOS_CHECK_GOTO(terrno, NULL, _return1);
|
||||||
}
|
}
|
||||||
|
|
||||||
q = taosMemoryCalloc(1, sizeof(SDelayQueue));
|
q = taosMemoryCalloc(1, sizeof(SDelayQueue));
|
||||||
if (q == NULL) {
|
if (q == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _return1);
|
TAOS_CHECK_GOTO(terrno, NULL, _return1);
|
||||||
}
|
}
|
||||||
q->heap = heap;
|
q->heap = heap;
|
||||||
q->timer = timer;
|
q->timer = timer;
|
||||||
|
|
|
@ -636,7 +636,7 @@ static int uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) {
|
||||||
if (pMsg->pCont == 0) {
|
if (pMsg->pCont == 0) {
|
||||||
pMsg->pCont = (void*)rpcMallocCont(0);
|
pMsg->pCont = (void*)rpcMallocCont(0);
|
||||||
if (pMsg->pCont == NULL) {
|
if (pMsg->pCont == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
pMsg->contLen = 0;
|
pMsg->contLen = 0;
|
||||||
|
@ -1027,7 +1027,7 @@ static int32_t addHandleToWorkloop(SWorkThrd* pThrd, char* pipeName) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
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) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((code = uv_loop_init(pThrd->loop)) != 0) {
|
if ((code = uv_loop_init(pThrd->loop)) != 0) {
|
||||||
|
@ -1135,7 +1135,7 @@ static FORCE_INLINE SSvrConn* createConn(void* hThrd) {
|
||||||
|
|
||||||
SSvrConn* pConn = (SSvrConn*)taosMemoryCalloc(1, sizeof(SSvrConn));
|
SSvrConn* pConn = (SSvrConn*)taosMemoryCalloc(1, sizeof(SSvrConn));
|
||||||
if (pConn == NULL) {
|
if (pConn == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
transReqQueueInit(&pConn->wreqQueue);
|
transReqQueueInit(&pConn->wreqQueue);
|
||||||
|
@ -1156,7 +1156,7 @@ static FORCE_INLINE SSvrConn* createConn(void* hThrd) {
|
||||||
|
|
||||||
SExHandle* exh = taosMemoryMalloc(sizeof(SExHandle));
|
SExHandle* exh = taosMemoryMalloc(sizeof(SExHandle));
|
||||||
if (exh == NULL) {
|
if (exh == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
exh->handle = pConn;
|
exh->handle = pConn;
|
||||||
|
@ -1187,7 +1187,7 @@ static FORCE_INLINE SSvrConn* createConn(void* hThrd) {
|
||||||
// init client handle
|
// init client handle
|
||||||
pConn->pTcp = (uv_tcp_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
pConn->pTcp = (uv_tcp_t*)taosMemoryMalloc(sizeof(uv_tcp_t));
|
||||||
if (pConn->pTcp == NULL) {
|
if (pConn->pTcp == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
|
TAOS_CHECK_GOTO(terrno, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
code = uv_tcp_init(pThrd->loop, pConn->pTcp);
|
code = uv_tcp_init(pThrd->loop, pConn->pTcp);
|
||||||
|
@ -1236,7 +1236,7 @@ static int32_t reallocConnRef(SSvrConn* conn) {
|
||||||
// avoid app continue to send msg on invalid handle
|
// avoid app continue to send msg on invalid handle
|
||||||
SExHandle* exh = taosMemoryMalloc(sizeof(SExHandle));
|
SExHandle* exh = taosMemoryMalloc(sizeof(SExHandle));
|
||||||
if (exh == NULL) {
|
if (exh == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
exh->handle = conn;
|
exh->handle = conn;
|
||||||
|
@ -1335,7 +1335,7 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
|
|
||||||
SServerObj* srv = taosMemoryCalloc(1, sizeof(SServerObj));
|
SServerObj* srv = taosMemoryCalloc(1, sizeof(SServerObj));
|
||||||
if (srv == NULL) {
|
if (srv == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
tError("failed to init server since: %s", tstrerror(code));
|
tError("failed to init server since: %s", tstrerror(code));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1349,7 +1349,7 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
srv->pThreadObj = (SWorkThrd**)taosMemoryCalloc(srv->numOfThreads, sizeof(SWorkThrd*));
|
srv->pThreadObj = (SWorkThrd**)taosMemoryCalloc(srv->numOfThreads, sizeof(SWorkThrd*));
|
||||||
srv->pipe = (uv_pipe_t**)taosMemoryCalloc(srv->numOfThreads, sizeof(uv_pipe_t*));
|
srv->pipe = (uv_pipe_t**)taosMemoryCalloc(srv->numOfThreads, sizeof(uv_pipe_t*));
|
||||||
if (srv->loop == NULL || srv->pThreadObj == NULL || srv->pipe == NULL) {
|
if (srv->loop == NULL || srv->pThreadObj == NULL || srv->pipe == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1400,14 +1400,14 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
thrd->pWhiteList = uvWhiteListCreate();
|
thrd->pWhiteList = uvWhiteListCreate();
|
||||||
if (thrd->pWhiteList == NULL) {
|
if (thrd->pWhiteList == NULL) {
|
||||||
destroyWorkThrdObj(thrd);
|
destroyWorkThrdObj(thrd);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
srv->pipe[i] = (uv_pipe_t*)taosMemoryCalloc(2, sizeof(uv_pipe_t));
|
srv->pipe[i] = (uv_pipe_t*)taosMemoryCalloc(2, sizeof(uv_pipe_t));
|
||||||
if (srv->pipe[i] == NULL) {
|
if (srv->pipe[i] == NULL) {
|
||||||
destroyWorkThrdObj(thrd);
|
destroyWorkThrdObj(thrd);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1433,7 +1433,7 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
for (int i = 0; i < srv->numOfThreads; i++) {
|
for (int i = 0; i < srv->numOfThreads; i++) {
|
||||||
SWorkThrd* thrd = (SWorkThrd*)taosMemoryCalloc(1, sizeof(SWorkThrd));
|
SWorkThrd* thrd = (SWorkThrd*)taosMemoryCalloc(1, sizeof(SWorkThrd));
|
||||||
if (thrd == NULL) {
|
if (thrd == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
srv->pThreadObj[i] = thrd;
|
srv->pThreadObj[i] = thrd;
|
||||||
|
@ -1444,13 +1444,13 @@ void* transInitServer(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
thrd->pWhiteList = uvWhiteListCreate();
|
thrd->pWhiteList = uvWhiteListCreate();
|
||||||
if (thrd->pWhiteList == NULL) {
|
if (thrd->pWhiteList == NULL) {
|
||||||
destroyWorkThrdObj(thrd);
|
destroyWorkThrdObj(thrd);
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
srv->pipe[i] = (uv_pipe_t*)taosMemoryCalloc(2, sizeof(uv_pipe_t));
|
srv->pipe[i] = (uv_pipe_t*)taosMemoryCalloc(2, sizeof(uv_pipe_t));
|
||||||
if (srv->pipe[i] == NULL) {
|
if (srv->pipe[i] == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
goto End;
|
goto End;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1599,7 +1599,7 @@ void uvHandleUpdate(SSvrMsg* msg, SWorkThrd* thrd) {
|
||||||
SIpWhiteList* pList = taosMemoryCalloc(1, sz + sizeof(SIpWhiteList));
|
SIpWhiteList* pList = taosMemoryCalloc(1, sz + sizeof(SIpWhiteList));
|
||||||
if (pList == NULL) {
|
if (pList == NULL) {
|
||||||
tError("failed to create ip-white-list since %s", tstrerror(code));
|
tError("failed to create ip-white-list since %s", tstrerror(code));
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = terrno;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pList->num = pUser->numOfRange;
|
pList->num = pUser->numOfRange;
|
||||||
|
|
|
@ -99,7 +99,7 @@ static FORCE_INLINE int32_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx, in
|
||||||
|
|
||||||
ptr = taosMemoryRealloc(buf, capacity);
|
ptr = taosMemoryRealloc(buf, capacity);
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _err);
|
TAOS_CHECK_GOTO(terrno, &lino, _err);
|
||||||
}
|
}
|
||||||
buf = ptr;
|
buf = ptr;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ static FORCE_INLINE int32_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx, in
|
||||||
capacity += extraSize;
|
capacity += extraSize;
|
||||||
void* ptr = taosMemoryRealloc(buf, capacity);
|
void* ptr = taosMemoryRealloc(buf, capacity);
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _err);
|
TAOS_CHECK_GOTO(terrno, &lino, _err);
|
||||||
}
|
}
|
||||||
buf = ptr;
|
buf = ptr;
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ static int32_t walRebuildFileInfoSet(SArray* metaLogList, SArray* actualLogList)
|
||||||
for (int i = 0; i < actualFileNum; i++) {
|
for (int i = 0; i < actualFileNum; i++) {
|
||||||
SWalFileInfo* pFileInfo = taosArrayGet(actualLogList, i);
|
SWalFileInfo* pFileInfo = taosArrayGet(actualLogList, i);
|
||||||
if (NULL == taosArrayPush(metaLogList, pFileInfo)) {
|
if (NULL == taosArrayPush(metaLogList, pFileInfo)) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ int32_t walRollFileInfo(SWal* pWal) {
|
||||||
// TODO: change to emplace back
|
// TODO: change to emplace back
|
||||||
SWalFileInfo* pNewInfo = taosMemoryMalloc(sizeof(SWalFileInfo));
|
SWalFileInfo* pNewInfo = taosMemoryMalloc(sizeof(SWalFileInfo));
|
||||||
if (pNewInfo == NULL) {
|
if (pNewInfo == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
pNewInfo->firstVer = pWal->vers.lastVer + 1;
|
pNewInfo->firstVer = pWal->vers.lastVer + 1;
|
||||||
pNewInfo->lastVer = -1;
|
pNewInfo->lastVer = -1;
|
||||||
|
@ -738,7 +738,7 @@ int32_t walRollFileInfo(SWal* pWal) {
|
||||||
pNewInfo->syncedOffset = 0;
|
pNewInfo->syncedOffset = 0;
|
||||||
if (!taosArrayPush(pArray, pNewInfo)) {
|
if (!taosArrayPush(pArray, pNewInfo)) {
|
||||||
taosMemoryFree(pNewInfo);
|
taosMemoryFree(pNewInfo);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(pNewInfo);
|
taosMemoryFree(pNewInfo);
|
||||||
|
@ -1015,7 +1015,7 @@ int32_t walLoadMeta(SWal* pWal) {
|
||||||
int size = (int)fileSize;
|
int size = (int)fileSize;
|
||||||
char* buf = taosMemoryMalloc(size + 5);
|
char* buf = taosMemoryMalloc(size + 5);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
(void)memset(buf, 0, size + 5);
|
(void)memset(buf, 0, size + 5);
|
||||||
TdFilePtr pFile = taosOpenFile(fnameStr, TD_FILE_READ);
|
TdFilePtr pFile = taosOpenFile(fnameStr, TD_FILE_READ);
|
||||||
|
|
|
@ -212,7 +212,7 @@ static int32_t walReadSeekVerImpl(SWalReader *pReader, int64_t ver) {
|
||||||
if (pRet == NULL) {
|
if (pRet == NULL) {
|
||||||
wError("failed to allocate memory for localRet");
|
wError("failed to allocate memory for localRet");
|
||||||
TAOS_UNUSED(taosThreadRwlockUnlock(&pWal->mutex));
|
TAOS_UNUSED(taosThreadRwlockUnlock(&pWal->mutex));
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
TAOS_MEMCPY(pRet, gloablPRet, sizeof(SWalFileInfo));
|
TAOS_MEMCPY(pRet, gloablPRet, sizeof(SWalFileInfo));
|
||||||
TAOS_UNUSED(taosThreadRwlockUnlock(&pWal->mutex));
|
TAOS_UNUSED(taosThreadRwlockUnlock(&pWal->mutex));
|
||||||
|
@ -341,7 +341,7 @@ int32_t walFetchBody(SWalReader *pRead) {
|
||||||
if (pRead->capacity < cryptedBodyLen) {
|
if (pRead->capacity < cryptedBodyLen) {
|
||||||
SWalCkHead *ptr = (SWalCkHead *)taosMemoryRealloc(pRead->pHead, sizeof(SWalCkHead) + cryptedBodyLen);
|
SWalCkHead *ptr = (SWalCkHead *)taosMemoryRealloc(pRead->pHead, sizeof(SWalCkHead) + cryptedBodyLen);
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
pRead->pHead = ptr;
|
pRead->pHead = ptr;
|
||||||
pReadHead = &pRead->pHead->head;
|
pReadHead = &pRead->pHead->head;
|
||||||
|
@ -463,7 +463,7 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
|
||||||
if (ptr == NULL) {
|
if (ptr == NULL) {
|
||||||
TAOS_UNUSED(taosThreadMutexUnlock(&pReader->mutex));
|
TAOS_UNUSED(taosThreadMutexUnlock(&pReader->mutex));
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
pReader->pHead = ptr;
|
pReader->pHead = ptr;
|
||||||
pReader->capacity = cryptedBodyLen;
|
pReader->capacity = cryptedBodyLen;
|
||||||
|
@ -523,7 +523,7 @@ int32_t decryptBody(SWalCfg *cfg, SWalCkHead *pHead, int32_t plainBodyLen, const
|
||||||
int32_t cryptedBodyLen = ENCRYPTED_LEN(plainBodyLen);
|
int32_t cryptedBodyLen = ENCRYPTED_LEN(plainBodyLen);
|
||||||
char *newBody = taosMemoryMalloc(cryptedBodyLen);
|
char *newBody = taosMemoryMalloc(cryptedBodyLen);
|
||||||
if (!newBody) {
|
if (!newBody) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCryptOpts opts;
|
SCryptOpts opts;
|
||||||
|
|
|
@ -51,7 +51,7 @@ int32_t cfgInit(SConfig **ppCfg) {
|
||||||
pCfg->array = taosArrayInit(32, sizeof(SConfigItem));
|
pCfg->array = taosArrayInit(32, sizeof(SConfigItem));
|
||||||
if (pCfg->array == NULL) {
|
if (pCfg->array == NULL) {
|
||||||
taosMemoryFree(pCfg);
|
taosMemoryFree(pCfg);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_CHECK_RETURN(taosThreadMutexInit(&pCfg->lock, NULL));
|
TAOS_CHECK_RETURN(taosThreadMutexInit(&pCfg->lock, NULL));
|
||||||
|
@ -127,7 +127,7 @@ static int32_t cfgCheckAndSetConf(SConfigItem *pItem, const char *conf) {
|
||||||
|
|
||||||
pItem->str = taosStrdup(conf);
|
pItem->str = taosStrdup(conf);
|
||||||
if (pItem->str == NULL) {
|
if (pItem->str == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
|
@ -144,7 +144,7 @@ static int32_t cfgCheckAndSetDir(SConfigItem *pItem, const char *inputDir) {
|
||||||
taosMemoryFreeClear(pItem->str);
|
taosMemoryFreeClear(pItem->str);
|
||||||
pItem->str = taosStrdup(fullDir);
|
pItem->str = taosStrdup(fullDir);
|
||||||
if (pItem->str == NULL) {
|
if (pItem->str == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
|
@ -211,7 +211,7 @@ static int32_t cfgSetString(SConfigItem *pItem, const char *value, ECfgSrcType s
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s", pItem->name, cfgDtypeStr(pItem->dtype),
|
uError("cfg:%s, type:%s src:%s value:%s failed to dup since %s", pItem->name, cfgDtypeStr(pItem->dtype),
|
||||||
cfgStypeStr(stype), value, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
cfgStypeStr(stype), value, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFreeClear(pItem->str);
|
taosMemoryFreeClear(pItem->str);
|
||||||
|
@ -272,7 +272,7 @@ static int32_t cfgSetTfsItem(SConfig *pCfg, const char *name, const char *value,
|
||||||
if (pItem->array == NULL) {
|
if (pItem->array == NULL) {
|
||||||
(void)taosThreadMutexUnlock(&pCfg->lock);
|
(void)taosThreadMutexUnlock(&pCfg->lock);
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ static int32_t cfgSetTfsItem(SConfig *pCfg, const char *name, const char *value,
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
(void)taosThreadMutexUnlock(&pCfg->lock);
|
(void)taosThreadMutexUnlock(&pCfg->lock);
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
pItem->stype = stype;
|
pItem->stype = stype;
|
||||||
|
@ -304,7 +304,7 @@ static int32_t cfgUpdateDebugFlagItem(SConfig *pCfg, const char *name, bool rese
|
||||||
if (pDebugFlagItem->array == NULL) {
|
if (pDebugFlagItem->array == NULL) {
|
||||||
pDebugFlagItem->array = taosArrayInit(16, sizeof(SLogVar));
|
pDebugFlagItem->array = taosArrayInit(16, sizeof(SLogVar));
|
||||||
if (pDebugFlagItem->array == NULL) {
|
if (pDebugFlagItem->array == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
taosArrayClear(pDebugFlagItem->array);
|
taosArrayClear(pDebugFlagItem->array);
|
||||||
|
@ -317,7 +317,7 @@ static int32_t cfgUpdateDebugFlagItem(SConfig *pCfg, const char *name, bool rese
|
||||||
SLogVar logVar = {0};
|
SLogVar logVar = {0};
|
||||||
(void)strncpy(logVar.name, name, TSDB_LOG_VAR_LEN - 1);
|
(void)strncpy(logVar.name, name, TSDB_LOG_VAR_LEN - 1);
|
||||||
if (NULL == taosArrayPush(pDebugFlagItem->array, &logVar)) {
|
if (NULL == taosArrayPush(pDebugFlagItem->array, &logVar)) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
|
@ -505,7 +505,7 @@ static int32_t cfgAddItem(SConfig *pCfg, SConfigItem *pItem, const char *name) {
|
||||||
pItem->stype = CFG_STYPE_DEFAULT;
|
pItem->stype = CFG_STYPE_DEFAULT;
|
||||||
pItem->name = taosStrdup(name);
|
pItem->name = taosStrdup(name);
|
||||||
if (pItem->name == NULL) {
|
if (pItem->name == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t size = taosArrayGetSize(pCfg->array);
|
int32_t size = taosArrayGetSize(pCfg->array);
|
||||||
|
@ -527,7 +527,7 @@ static int32_t cfgAddItem(SConfig *pCfg, SConfigItem *pItem, const char *name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(pItem->name);
|
taosMemoryFree(pItem->name);
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
|
@ -587,7 +587,7 @@ int32_t cfgAddString(SConfig *pCfg, const char *name, const char *defaultVal, in
|
||||||
SConfigItem item = {.dtype = CFG_DTYPE_STRING, .scope = scope, .dynScope = dynScope};
|
SConfigItem item = {.dtype = CFG_DTYPE_STRING, .scope = scope, .dynScope = dynScope};
|
||||||
item.str = taosStrdup(defaultVal);
|
item.str = taosStrdup(defaultVal);
|
||||||
if (item.str == NULL) {
|
if (item.str == NULL) {
|
||||||
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_RETURN(terrno);
|
||||||
}
|
}
|
||||||
return cfgAddItem(pCfg, &item, name);
|
return cfgAddItem(pCfg, &item, name);
|
||||||
}
|
}
|
||||||
|
@ -1309,7 +1309,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
|
||||||
size_t itemValueStringLen = strlen(itemValueString);
|
size_t itemValueStringLen = strlen(itemValueString);
|
||||||
void *px = taosMemoryRealloc(cfgLineBuf, itemNameLen + itemValueStringLen + 3);
|
void *px = taosMemoryRealloc(cfgLineBuf, itemNameLen + itemValueStringLen + 3);
|
||||||
if (NULL == px) {
|
if (NULL == px) {
|
||||||
TAOS_CHECK_EXIT(TSDB_CODE_OUT_OF_MEMORY);
|
TAOS_CHECK_EXIT(terrno);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfgLineBuf = px;
|
cfgLineBuf = px;
|
||||||
|
|
|
@ -352,7 +352,7 @@ int32_t taosHashPut(SHashObj *pHashObj, const void *key, size_t keyLen, const vo
|
||||||
// no data in hash table with the specified key, add it into hash table
|
// no data in hash table with the specified key, add it into hash table
|
||||||
SHashNode *pNewNode = doCreateHashNode(key, keyLen, data, size, hashVal);
|
SHashNode *pNewNode = doCreateHashNode(key, keyLen, data, size, hashVal);
|
||||||
if (pNewNode == NULL) {
|
if (pNewNode == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
code = terrno;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ int32_t taosHashPut(SHashObj *pHashObj, const void *key, size_t keyLen, const vo
|
||||||
if (pHashObj->enableUpdate) {
|
if (pHashObj->enableUpdate) {
|
||||||
SHashNode *pNewNode = doCreateHashNode(key, keyLen, data, size, hashVal);
|
SHashNode *pNewNode = doCreateHashNode(key, keyLen, data, size, hashVal);
|
||||||
if (pNewNode == NULL) {
|
if (pNewNode == NULL) {
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
// terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
code = terrno;
|
code = terrno;
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ int32_t tjsonAddArray(SJson* pJson, const char* pName, FToJson func, const void*
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
SJson* pJsonArray = tjsonAddArrayToObject(pJson, pName);
|
SJson* pJsonArray = tjsonAddArrayToObject(pJson, pName);
|
||||||
if (NULL == pJsonArray) {
|
if (NULL == pJsonArray) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < num; ++i) {
|
for (size_t i = 0; i < num; ++i) {
|
||||||
int32_t code = tjsonAddItem(pJsonArray, func, (const char*)pArray + itemSize * i);
|
int32_t code = tjsonAddItem(pJsonArray, func, (const char*)pArray + itemSize * i);
|
||||||
|
@ -148,7 +148,7 @@ int32_t tjsonAddTArray(SJson* pJson, const char* pName, FToJson func, const SArr
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
SJson* pJsonArray = tjsonAddArrayToObject(pJson, pName);
|
SJson* pJsonArray = tjsonAddArrayToObject(pJson, pName);
|
||||||
if (NULL == pJsonArray) {
|
if (NULL == pJsonArray) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
for (int32_t i = 0; i < num; ++i) {
|
for (int32_t i = 0; i < num; ++i) {
|
||||||
int32_t code = tjsonAddItem(pJsonArray, func, taosArrayGet(pArray, i));
|
int32_t code = tjsonAddItem(pJsonArray, func, taosArrayGet(pArray, i));
|
||||||
|
@ -343,7 +343,7 @@ int32_t tjsonToTArray(const SJson* pJson, const char* pName, FToObject func, SAr
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
*pArray = taosArrayInit_s(itemSize, size);
|
*pArray = taosArrayInit_s(itemSize, size);
|
||||||
if (NULL == *pArray) {
|
if (NULL == *pArray) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
for (int32_t i = 0; i < size; ++i) {
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
int32_t code = func(tjsonGetArrayItem(jArray, i), taosArrayGet(*pArray, i));
|
int32_t code = func(tjsonGetArrayItem(jArray, i), taosArrayGet(*pArray, i));
|
||||||
|
|
|
@ -57,7 +57,7 @@ static int32_t createDiskFile(SDiskbasedBuf* pBuf) {
|
||||||
taosGetTmpfilePath(pBuf->prefix, "paged-buf", path);
|
taosGetTmpfilePath(pBuf->prefix, "paged-buf", path);
|
||||||
pBuf->path = taosStrdup(path);
|
pBuf->path = taosStrdup(path);
|
||||||
if (pBuf->path == NULL) {
|
if (pBuf->path == NULL) {
|
||||||
return TSDB_CODE_OUT_OF_MEMORY;
|
return terrno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -803,11 +803,11 @@ int32_t tQueryAutoQWorkerInit(SQueryAutoQWorkerPool *pool) {
|
||||||
code = taosOpenQset(&pool->qset);
|
code = taosOpenQset(&pool->qset);
|
||||||
if (code) return terrno = code;
|
if (code) return terrno = code;
|
||||||
pool->workers = tdListNew(sizeof(SQueryAutoQWorker));
|
pool->workers = tdListNew(sizeof(SQueryAutoQWorker));
|
||||||
if (!pool->workers) return TSDB_CODE_OUT_OF_MEMORY;
|
if (!pool->workers) return terrno;
|
||||||
pool->backupWorkers = tdListNew(sizeof(SQueryAutoQWorker));
|
pool->backupWorkers = tdListNew(sizeof(SQueryAutoQWorker));
|
||||||
if (!pool->backupWorkers) return TSDB_CODE_OUT_OF_MEMORY;
|
if (!pool->backupWorkers) return terrno;
|
||||||
pool->exitedWorkers = tdListNew(sizeof(SQueryAutoQWorker));
|
pool->exitedWorkers = tdListNew(sizeof(SQueryAutoQWorker));
|
||||||
if (!pool->exitedWorkers) return TSDB_CODE_OUT_OF_MEMORY;
|
if (!pool->exitedWorkers) return terrno;
|
||||||
pool->maxInUse = pool->max * 2 + 2;
|
pool->maxInUse = pool->max * 2 + 2;
|
||||||
|
|
||||||
if (!pool->pCb) {
|
if (!pool->pCb) {
|
||||||
|
|
Loading…
Reference in New Issue