fix: fix double send resp

This commit is contained in:
yihaoDeng 2023-02-22 16:40:13 +08:00
parent b8b2b8a23a
commit 27c12787f7
2 changed files with 5 additions and 5 deletions

View File

@ -160,7 +160,6 @@ static int32_t vmPutMsgToQueue(SVnodeMgmt *pMgmt, SRpcMsg *pMsg, EQueueType qtyp
dGError("vgId:%d, msg:%p failed to put into vnode queue since %s, type:%s qtype:%d contLen:%d", pHead->vgId, pMsg,
terrstr(), TMSG_INFO(pMsg->msgType), qtype, pHead->contLen);
terrno = (terrno != 0) ? terrno : -1;
vmSendResponse(pMsg);
return terrno;
}

View File

@ -88,6 +88,11 @@ void* rpcOpen(const SRpcInit* pInit) {
pRpc->connType = pInit->connType;
pRpc->idleTime = pInit->idleTime;
pRpc->parent = pInit->parent;
if (pInit->user) {
tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user));
}
pRpc->tcphandle =
(*taosInitHandle[pRpc->connType])(ip, pInit->localPort, pRpc->label, pRpc->numOfThreads, NULL, pRpc);
@ -95,10 +100,6 @@ void* rpcOpen(const SRpcInit* pInit) {
taosMemoryFree(pRpc);
return NULL;
}
pRpc->parent = pInit->parent;
if (pInit->user) {
tstrncpy(pRpc->user, pInit->user, sizeof(pRpc->user));
}
int64_t refId = transAddExHandle(transGetInstMgt(), pRpc);
transAcquireExHandle(transGetInstMgt(), refId);