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