From 780fe1eded854c0fce067b9308f18d966889c803 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 4 Feb 2021 22:42:34 +0000 Subject: [PATCH 1/8] fix mem leak --- src/query/src/qExecutor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 9b6d2b7791..bfca7a63e8 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -7649,7 +7649,10 @@ int32_t qDumpRetrieveResult(qinfo_t qinfo, SRetrieveTableRsp **pRsp, int32_t *co *continueExec = true; qDebug("QInfo:%p has more results to retrieve", pQInfo); } - + if (pQInfo->code != TSDB_CODE_SUCCESS) { + rpcFreeCont(*pRsp); + *pRsp = NULL; + } return pQInfo->code; } From 449aaea0f031d4938c45c28b0327768afeef29df Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 5 Feb 2021 14:27:42 +0000 Subject: [PATCH 2/8] patch --- src/client/src/tscSystem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 52ede2318f..1f54417686 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -154,6 +154,7 @@ void taos_init_imp(void) { if (tscNumOfThreads < 2) { tscNumOfThreads = 2; } + taosTmrThreads = tscNumOfThreads; tscQhandle = taosInitScheduler(queueSize, tscNumOfThreads, "tsc"); if (NULL == tscQhandle) { From 1fba96a651d4f50813354cf59dc057ec5874e4e8 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 5 Feb 2021 17:56:36 +0000 Subject: [PATCH 3/8] test --- src/client/src/tscSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 1f54417686..2b6634fece 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -87,7 +87,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry rpcInit.sessions = tsMaxConnections; rpcInit.connType = TAOS_CONN_CLIENT; rpcInit.user = (char *)user; - rpcInit.idleTime = tsShellActivityTimer * 1000; + rpcInit.idleTime = 2 * 1000; rpcInit.ckey = "key"; rpcInit.spi = 1; rpcInit.secret = (char *)secretEncrypt; From c11849d0d64800b5c371ccfc81d7ae1281ec67ee Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 5 Feb 2021 20:00:56 +0000 Subject: [PATCH 4/8] fix crash bug --- src/client/src/tscSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 2b6634fece..d8c986e550 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -64,7 +64,7 @@ void tscReleaseRpc(void *param) { return; } pthread_mutex_lock(&rpcObjMutex); - taosCacheRelease(tscRpcCache, (void *)¶m, true); + taosCacheRelease(tscRpcCache, (void *)¶m, false); pthread_mutex_unlock(&rpcObjMutex); } From 8f6297f0ca7886d4ce1b39fc9092880b21b23fbc Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 5 Feb 2021 21:36:01 +0000 Subject: [PATCH 5/8] revert code --- src/client/src/tscSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index d8c986e550..7a685c9f56 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -87,7 +87,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry rpcInit.sessions = tsMaxConnections; rpcInit.connType = TAOS_CONN_CLIENT; rpcInit.user = (char *)user; - rpcInit.idleTime = 2 * 1000; + rpcInit.idleTime = tsShellActivityTimer * 1000;; rpcInit.ckey = "key"; rpcInit.spi = 1; rpcInit.secret = (char *)secretEncrypt; From 7247c3c900a0313efdee3a5e50acfa80d1ad8377 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 5 Feb 2021 22:13:39 +0000 Subject: [PATCH 6/8] fix bug --- src/client/src/tscSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 7a685c9f56..9a9217ef68 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -101,7 +101,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry tscError("failed to init connection to TDengine"); return -1; } - pRpcObj = taosCachePut(tscRpcCache, rpcObj.key, strlen(rpcObj.key), &rpcObj, sizeof(rpcObj), 1000*10); + pRpcObj = taosCachePut(tscRpcCache, rpcObj.key, strlen(rpcObj.key), &rpcObj, sizeof(rpcObj), 1000*2); if (pRpcObj == NULL) { rpcClose(rpcObj.pDnodeConn); pthread_mutex_unlock(&rpcObjMutex); From 5938b124058d8d0afa8b300a1cf262afee5c2268 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 5 Feb 2021 22:25:25 +0000 Subject: [PATCH 7/8] fix bug --- src/client/src/tscSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 9a9217ef68..f7422c05fa 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -101,7 +101,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry tscError("failed to init connection to TDengine"); return -1; } - pRpcObj = taosCachePut(tscRpcCache, rpcObj.key, strlen(rpcObj.key), &rpcObj, sizeof(rpcObj), 1000*2); + pRpcObj = taosCachePut(tscRpcCache, rpcObj.key, strlen(rpcObj.key), &rpcObj, sizeof(rpcObj), 1000*5); if (pRpcObj == NULL) { rpcClose(rpcObj.pDnodeConn); pthread_mutex_unlock(&rpcObjMutex); From 9c73dce320c420a8eb43d121929c9b4abafd701f Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sat, 6 Feb 2021 00:46:03 +0000 Subject: [PATCH 8/8] rerun full test --- src/client/src/tscSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index f7422c05fa..92736b005f 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -87,7 +87,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry rpcInit.sessions = tsMaxConnections; rpcInit.connType = TAOS_CONN_CLIENT; rpcInit.user = (char *)user; - rpcInit.idleTime = tsShellActivityTimer * 1000;; + rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.ckey = "key"; rpcInit.spi = 1; rpcInit.secret = (char *)secretEncrypt;