Merge pull request #15845 from taosdata/fix/avoidTimer
fix: avoid start timer
This commit is contained in:
commit
dc5325544d
|
@ -126,7 +126,7 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) {
|
||||||
rpcInit.numOfThreads = numOfThread;
|
rpcInit.numOfThreads = numOfThread;
|
||||||
rpcInit.cfp = processMsgFromServer;
|
rpcInit.cfp = processMsgFromServer;
|
||||||
rpcInit.rfp = clientRpcRfp;
|
rpcInit.rfp = clientRpcRfp;
|
||||||
rpcInit.tfp = clientRpcTfp;
|
// rpcInit.tfp = clientRpcTfp;
|
||||||
rpcInit.sessions = 1024;
|
rpcInit.sessions = 1024;
|
||||||
rpcInit.connType = TAOS_CONN_CLIENT;
|
rpcInit.connType = TAOS_CONN_CLIENT;
|
||||||
rpcInit.user = (char *)user;
|
rpcInit.user = (char *)user;
|
||||||
|
|
|
@ -105,13 +105,13 @@ typedef SRpcCtxVal STransCtxVal;
|
||||||
typedef SRpcInfo STrans;
|
typedef SRpcInfo STrans;
|
||||||
typedef SRpcConnInfo STransHandleInfo;
|
typedef SRpcConnInfo STransHandleInfo;
|
||||||
|
|
||||||
// ref mgt
|
// ref mgt handle
|
||||||
// handle
|
|
||||||
typedef struct SExHandle {
|
typedef struct SExHandle {
|
||||||
void* handle;
|
void* handle;
|
||||||
int64_t refId;
|
int64_t refId;
|
||||||
void* pThrd;
|
void* pThrd;
|
||||||
} SExHandle;
|
} SExHandle;
|
||||||
|
|
||||||
/*convet from fqdn to ip */
|
/*convet from fqdn to ip */
|
||||||
typedef struct SCvtAddr {
|
typedef struct SCvtAddr {
|
||||||
char ip[TSDB_FQDN_LEN];
|
char ip[TSDB_FQDN_LEN];
|
||||||
|
|
|
@ -222,14 +222,13 @@ SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb)
|
||||||
pool->asyncs = taosMemoryCalloc(1, sizeof(uv_async_t) * pool->nAsync);
|
pool->asyncs = taosMemoryCalloc(1, sizeof(uv_async_t) * pool->nAsync);
|
||||||
|
|
||||||
for (int i = 0; i < pool->nAsync; i++) {
|
for (int i = 0; i < pool->nAsync; i++) {
|
||||||
uv_async_t* async = &(pool->asyncs[i]);
|
|
||||||
uv_async_init(loop, async, cb);
|
|
||||||
|
|
||||||
SAsyncItem* item = taosMemoryCalloc(1, sizeof(SAsyncItem));
|
SAsyncItem* item = taosMemoryCalloc(1, sizeof(SAsyncItem));
|
||||||
item->pThrd = arg;
|
item->pThrd = arg;
|
||||||
QUEUE_INIT(&item->qmsg);
|
QUEUE_INIT(&item->qmsg);
|
||||||
taosThreadMutexInit(&item->mtx, NULL);
|
taosThreadMutexInit(&item->mtx, NULL);
|
||||||
|
|
||||||
|
uv_async_t* async = &(pool->asyncs[i]);
|
||||||
|
uv_async_init(loop, async, cb);
|
||||||
async->data = item;
|
async->data = item;
|
||||||
}
|
}
|
||||||
return pool;
|
return pool;
|
||||||
|
@ -238,7 +237,7 @@ SAsyncPool* transAsyncPoolCreate(uv_loop_t* loop, int sz, void* arg, AsyncCB cb)
|
||||||
void transAsyncPoolDestroy(SAsyncPool* pool) {
|
void transAsyncPoolDestroy(SAsyncPool* pool) {
|
||||||
for (int i = 0; i < pool->nAsync; i++) {
|
for (int i = 0; i < pool->nAsync; i++) {
|
||||||
uv_async_t* async = &(pool->asyncs[i]);
|
uv_async_t* async = &(pool->asyncs[i]);
|
||||||
// uv_close((uv_handle_t*)async, NULL);
|
|
||||||
SAsyncItem* item = async->data;
|
SAsyncItem* item = async->data;
|
||||||
taosThreadMutexDestroy(&item->mtx);
|
taosThreadMutexDestroy(&item->mtx);
|
||||||
taosMemoryFree(item);
|
taosMemoryFree(item);
|
||||||
|
|
Loading…
Reference in New Issue