remove a potential rpcSendRecv deadlock
This commit is contained in:
parent
71afc90b36
commit
4e0f1055dc
|
@ -630,7 +630,14 @@ static void rpcReleaseConn(SRpcConn *pConn) {
|
||||||
} else {
|
} else {
|
||||||
// if there is an outgoing message, free it
|
// if there is an outgoing message, free it
|
||||||
if (pConn->outType && pConn->pReqMsg) {
|
if (pConn->outType && pConn->pReqMsg) {
|
||||||
if (pConn->pContext) pConn->pContext->pConn = NULL;
|
if (pContext->pRsp) {
|
||||||
|
// for synchronous API, post semaphore to unblock app
|
||||||
|
pContext->pRsp->code = TSDB_CODE_RPC_APP_ERROR;
|
||||||
|
pContext->pRsp->pCont = NULL;
|
||||||
|
pContext->pRsp->contLen = 0;
|
||||||
|
tsem_post(pContext->pSem);
|
||||||
|
}
|
||||||
|
pConn->pContext->pConn = NULL;
|
||||||
taosRemoveRef(tsRpcRefId, pConn->pContext->rid);
|
taosRemoveRef(tsRpcRefId, pConn->pContext->rid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue