fix mem problem
This commit is contained in:
parent
0adc07e712
commit
c35513a507
|
@ -130,12 +130,13 @@ int taosSetAutoDelFile(char *path);
|
||||||
bool lastErrorIsFileNotExist();
|
bool lastErrorIsFileNotExist();
|
||||||
|
|
||||||
#ifdef BUILD_WITH_RAND_ERR
|
#ifdef BUILD_WITH_RAND_ERR
|
||||||
#define STUB_RAND_NETWORK_ERR(status) \
|
#define STUB_RAND_NETWORK_ERR(ret) \
|
||||||
do { \
|
do { \
|
||||||
if (tsEnableRandErr && (tsRandErrScope & RAND_ERR_NETWORK)) { \
|
if (tsEnableRandErr && (tsRandErrScope & RAND_ERR_NETWORK)) { \
|
||||||
uint32_t r = taosRand() % tsRandErrDivisor; \
|
uint32_t r = taosRand() % tsRandErrDivisor; \
|
||||||
if ((r + 1) <= tsRandErrChance) { \
|
if ((r + 1) <= tsRandErrChance) { \
|
||||||
status = TSDB_CODE_RPC_NETWORK_UNAVAIL; \
|
ret = TSDB_CODE_RPC_NETWORK_UNAVAIL; \
|
||||||
|
uError("random network error: %s, %s", tstrerror(ret), __func__); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
while (0)
|
while (0)
|
||||||
|
|
|
@ -1191,6 +1191,7 @@ void* transWorkerThread(void* arg) {
|
||||||
static FORCE_INLINE SSvrConn* createConn(void* hThrd) {
|
static FORCE_INLINE SSvrConn* createConn(void* hThrd) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
SWorkThrd* pThrd = hThrd;
|
SWorkThrd* pThrd = hThrd;
|
||||||
|
STrans* pTransInst = pThrd->pTransInst;
|
||||||
|
|
||||||
SSvrConn* pConn = (SSvrConn*)taosMemoryCalloc(1, sizeof(SSvrConn));
|
SSvrConn* pConn = (SSvrConn*)taosMemoryCalloc(1, sizeof(SSvrConn));
|
||||||
if (pConn == NULL) {
|
if (pConn == NULL) {
|
||||||
|
@ -1232,7 +1233,6 @@ static FORCE_INLINE SSvrConn* createConn(void* hThrd) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _end);
|
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _end);
|
||||||
}
|
}
|
||||||
|
|
||||||
STrans* pTransInst = pThrd->pTransInst;
|
|
||||||
pConn->refId = exh->refId;
|
pConn->refId = exh->refId;
|
||||||
QUEUE_INIT(&exh->q);
|
QUEUE_INIT(&exh->q);
|
||||||
transRefSrvHandle(pConn);
|
transRefSrvHandle(pConn);
|
||||||
|
|
Loading…
Reference in New Issue