add mem check
This commit is contained in:
parent
2af86c961a
commit
3eaae2ab75
|
@ -1215,8 +1215,7 @@ void cliSendBatch(SCliConn* pConn) {
|
||||||
if (req == NULL) {
|
if (req == NULL) {
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY;
|
code = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
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));
|
||||||
taosMemoryFree(wb);
|
goto _except;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
req->data = pConn;
|
req->data = pConn;
|
||||||
tDebug("%s conn %p start to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(pConn), pConn,
|
tDebug("%s conn %p start to send batch msg, batch size:%d, msgLen:%d", CONN_GET_INST_LABEL(pConn), pConn,
|
||||||
|
@ -1225,12 +1224,15 @@ void cliSendBatch(SCliConn* pConn) {
|
||||||
code = uv_write(req, (uv_stream_t*)pConn->stream, wb, wLen, cliSendBatchCb);
|
code = uv_write(req, (uv_stream_t*)pConn->stream, wb, wLen, cliSendBatchCb);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
tDebug("%s conn %p failed to to send batch msg since %s", CONN_GET_INST_LABEL(pConn), pConn, uv_err_name(code));
|
tDebug("%s conn %p failed to to send batch msg since %s", CONN_GET_INST_LABEL(pConn), pConn, uv_err_name(code));
|
||||||
|
goto _except;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosMemoryFree(wb);
|
taosMemoryFree(wb);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_except:
|
_except:
|
||||||
cliDestroyBatch(pBatch);
|
cliDestroyBatch(pBatch);
|
||||||
|
taosMemoryFree(wb);
|
||||||
pConn->pBatch = NULL;
|
pConn->pBatch = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2033,10 +2035,7 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) {
|
||||||
|
|
||||||
QUEUE_PUSH(&((*ppBatchList)->wq), &pBatch->listq);
|
QUEUE_PUSH(&((*ppBatchList)->wq), &pBatch->listq);
|
||||||
(*ppBatchList)->len += 1;
|
(*ppBatchList)->len += 1;
|
||||||
|
} else {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
queue* hdr = QUEUE_TAIL(&((*ppBatchList)->wq));
|
queue* hdr = QUEUE_TAIL(&((*ppBatchList)->wq));
|
||||||
SCliBatch* pBatch = QUEUE_DATA(hdr, SCliBatch, listq);
|
SCliBatch* pBatch = QUEUE_DATA(hdr, SCliBatch, listq);
|
||||||
if ((pBatch->batchSize + pMsg->msg.contLen) < (*ppBatchList)->batchLenLimit) {
|
if ((pBatch->batchSize + pMsg->msg.contLen) < (*ppBatchList)->batchLenLimit) {
|
||||||
|
@ -2062,6 +2061,7 @@ static void cliBatchDealReq(queue* wq, SCliThrd* pThrd) {
|
||||||
(*ppBatchList)->len += 1;
|
(*ppBatchList)->len += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
(*cliAsyncHandle[pMsg->type])(pMsg, pThrd);
|
(*cliAsyncHandle[pMsg->type])(pMsg, pThrd);
|
||||||
|
|
Loading…
Reference in New Issue