Merge remote-tracking branch 'origin/3.0' into enh/opt-transport
This commit is contained in:
parent
01c362840f
commit
5df93eab17
|
@ -172,6 +172,7 @@ typedef struct SCliThrd {
|
||||||
|
|
||||||
SArray* pQIdBuf; // tmp buf to avoid alloc buf;
|
SArray* pQIdBuf; // tmp buf to avoid alloc buf;
|
||||||
queue batchSendSet;
|
queue batchSendSet;
|
||||||
|
int8_t thrdInited;
|
||||||
} SCliThrd;
|
} SCliThrd;
|
||||||
|
|
||||||
typedef struct SCliObj {
|
typedef struct SCliObj {
|
||||||
|
@ -2238,11 +2239,13 @@ void* transInitClient(uint32_t ip, uint32_t port, char* label, int numOfThreads,
|
||||||
|
|
||||||
int err = taosThreadCreate(&pThrd->thread, NULL, cliWorkThread, (void*)(pThrd));
|
int err = taosThreadCreate(&pThrd->thread, NULL, cliWorkThread, (void*)(pThrd));
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
|
destroyThrdObj(pThrd);
|
||||||
code = TAOS_SYSTEM_ERROR(errno);
|
code = TAOS_SYSTEM_ERROR(errno);
|
||||||
TAOS_CHECK_GOTO(code, NULL, _err);
|
TAOS_CHECK_GOTO(code, NULL, _err);
|
||||||
} else {
|
} else {
|
||||||
tDebug("success to create tranport-cli thread:%d", i);
|
tDebug("success to create tranport-cli thread:%d", i);
|
||||||
}
|
}
|
||||||
|
pThrd->thrdInited = 1;
|
||||||
cli->pThreadObj[i] = pThrd;
|
cli->pThreadObj[i] = pThrd;
|
||||||
}
|
}
|
||||||
return cli;
|
return cli;
|
||||||
|
@ -2433,7 +2436,7 @@ static void destroyThrdObj(SCliThrd* pThrd) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taosThreadJoin(pThrd->thread, NULL) != 0) {
|
if (pThrd->thrdInited && taosThreadJoin(pThrd->thread, NULL) != 0) {
|
||||||
tTrace("failed to join thread since %s", tstrerror(terrno));
|
tTrace("failed to join thread since %s", tstrerror(terrno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue