From 43269e057b5c2aece860ac299c9b8bb581495290 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Mon, 1 Aug 2022 10:53:01 +0800 Subject: [PATCH] fix: fix expired connections still showed issue --- source/dnode/mnode/impl/src/mndProfile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/dnode/mnode/impl/src/mndProfile.c b/source/dnode/mnode/impl/src/mndProfile.c index 4b57f45631..e55c562e38 100644 --- a/source/dnode/mnode/impl/src/mndProfile.c +++ b/source/dnode/mnode/impl/src/mndProfile.c @@ -687,6 +687,7 @@ static int32_t mndRetrieveConns(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl int32_t numOfRows = 0; int32_t cols = 0; SConnObj *pConn = NULL; + int32_t keepTime = tsShellActivityTimer * 3; if (pShow->pIter == NULL) { SProfileMgmt *pMgmt = &pMnode->profileMgmt; @@ -700,6 +701,10 @@ static int32_t mndRetrieveConns(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl break; } + if ((taosGetTimestampMs() - pConn->lastAccessTimeMs) > (keepTime * 1000)) { + continue; + } + cols = 0; SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);