From 89a76a0d66c7bf51416484cacbca68098d959c35 Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Thu, 15 Oct 2020 09:47:37 +0800 Subject: [PATCH] fix td-1706: leak of connection id --- src/rpc/src/rpcMain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index ad247ad25b..63231bb1fa 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -1051,6 +1051,9 @@ static void *rpcProcessMsgFromPeer(SRecvInfo *pRecv) { if (code != 0) { // parsing error if (rpcIsReq(pHead->msgType)) { rpcSendErrorMsgToPeer(pRecv, code); + if (code == TSDB_CODE_RPC_INVALID_TIME_STAMP || code == TSDB_CODE_RPC_AUTH_FAILURE) { + rpcCloseConn(pConn); + } tDebug("%s %p %p, %s is sent with error code:0x%x", pRpc->label, pConn, (void *)pHead->ahandle, taosMsg[pHead->msgType+1], code); } } else { // msg is passed to app only parsing is ok -- GitLab