From 93f4c2be9639632bedbaaec7c3dbbe569fd1cf47 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sat, 30 Jan 2021 23:00:31 +0000 Subject: [PATCH 1/2] td-2894 --- 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 62ae2cd709..64bd474ac4 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -88,7 +88,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 = 2000; + rpcInit.idleTime = tsShellActivityTimer * 1000; rpcInit.ckey = "key"; rpcInit.spi = 1; rpcInit.secret = (char *)secretEncrypt; From d324102f85ee33b8d184bd7c40f704ef0462689b Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Sun, 31 Jan 2021 00:05:33 +0000 Subject: [PATCH 2/2] TD-2885 --- src/cq/src/cqMain.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/cq/src/cqMain.c b/src/cq/src/cqMain.c index a5de27d7fc..cc1628c968 100644 --- a/src/cq/src/cqMain.c +++ b/src/cq/src/cqMain.c @@ -125,8 +125,6 @@ void cqFree(void *handle) { pthread_mutex_unlock(&pContext->mutex); if (delete) { - pthread_mutex_unlock(&pContext->mutex); - pthread_mutex_destroy(&pContext->mutex); taosTmrCleanUp(pContext->tmrCtrl); @@ -186,6 +184,18 @@ void *cqOpen(void *ahandle, const SCqCfg *pCfg) { return pContext; } +static void freeSCqContext(void *handle) { + if (handle == NULL) { + return; + } + SCqContext *pContext = handle; + pthread_mutex_destroy(&pContext->mutex); + + taosTmrCleanUp(pContext->tmrCtrl); + pContext->tmrCtrl = NULL; + cDebug("vgId:%d, CQ is closed", pContext->vgId); + free(pContext); +} void cqClose(void *handle) { if (tsEnableStream == 0) { return; @@ -217,6 +227,7 @@ void cqClose(void *handle) { taosRemoveRef(cqObjRef, rid); } + freeSCqContext(pContext); } void cqStart(void *handle) {