add debug log

This commit is contained in:
yihaoDeng 2024-08-02 19:50:06 +08:00 committed by wangjiaming0909
parent 1dd5461cdd
commit 7cbd3324ee
2 changed files with 11 additions and 3 deletions

View File

@ -167,7 +167,7 @@ int32_t rpcSendRequest(void* shandle, const SEpSet* pEpSet, SRpcMsg* pMsg, int64
return transSendRequest(shandle, pEpSet, pMsg, NULL); return transSendRequest(shandle, pEpSet, pMsg, NULL);
} }
int32_t rpcSendRequestWithCtx(void* shandle, const SEpSet* pEpSet, SRpcMsg* pMsg, int64_t* pRid, SRpcCtx* pCtx) { int32_t rpcSendRequestWithCtx(void* shandle, const SEpSet* pEpSet, SRpcMsg* pMsg, int64_t* pRid, SRpcCtx* pCtx) {
if (pCtx != NULL || pMsg->info.handle != 0 || pRid == NULL) { if (pCtx != NULL || pMsg->info.handle != 0 || pMsg->info.noResp != 0|| pRid == NULL) {
return transSendRequest(shandle, pEpSet, pMsg, pCtx); return transSendRequest(shandle, pEpSet, pMsg, pCtx);
} else { } else {
return transSendRequestWithId(shandle, pEpSet, pMsg, pRid); return transSendRequestWithId(shandle, pEpSet, pMsg, pRid);

View File

@ -901,10 +901,12 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) {
exh->handle = conn; exh->handle = conn;
exh->pThrd = conn->hostThrd; exh->pThrd = conn->hostThrd;
taosWUnLockLatch(&exh->latch); taosWUnLockLatch(&exh->latch);
conn->refId = exh->refId; conn->refId = exh->refId;
taosWUnLockLatch(&exh->latch); taosWUnLockLatch(&exh->latch);
tDebug("conn %p specified by %"PRId64"", conn, handle);
(void)transReleaseExHandle(transGetRefMgt(), handle); (void)transReleaseExHandle(transGetRefMgt(), handle);
return 0; return 0;
} }
@ -1608,6 +1610,7 @@ static void cliHandleFreeById(SCliMsg* pMsg, SCliThrd* pThrd) {
if (conn == NULL || conn->refId != refId) { if (conn == NULL || conn->refId != refId) {
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _exception); TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _exception);
} }
tDebug("do free conn %p by id %" PRId64 "", conn, refId);
int32_t size = transQueueSize(&conn->cliMsgs); int32_t size = transQueueSize(&conn->cliMsgs);
if (size == 0) { if (size == 0) {
@ -1619,6 +1622,8 @@ static void cliHandleFreeById(SCliMsg* pMsg, SCliThrd* pThrd) {
} }
return; return;
_exception: _exception:
tDebug("already free conn %p by id %" PRId64"", conn, refId);
(void)transReleaseExHandle(transGetRefMgt(), refId); (void)transReleaseExHandle(transGetRefMgt(), refId);
destroyCmsg(pMsg); destroyCmsg(pMsg);
} }
@ -3260,7 +3265,8 @@ int32_t transFreeConnById(void* shandle, int64_t transpointId) {
return TSDB_CODE_RPC_MODULE_QUIT; return TSDB_CODE_RPC_MODULE_QUIT;
} }
if (transpointId == 0) { if (transpointId == 0) {
TAOS_CHECK_GOTO(TSDB_CODE_REF_INVALID_ID, NULL, _exception); tDebug("not free by refId:%"PRId64"", transpointId);
TAOS_CHECK_GOTO(0, NULL, _exception);
} }
SCliThrd* pThrd = transGetWorkThrdFromHandle(pTransInst, transpointId); SCliThrd* pThrd = transGetWorkThrdFromHandle(pTransInst, transpointId);
@ -3274,6 +3280,8 @@ int32_t transFreeConnById(void* shandle, int64_t transpointId) {
} }
pCli->type = FreeById; pCli->type = FreeById;
tDebug("release conn By refId %" PRId64 "", transpointId);
STransMsg msg = {.info.handle = (void*)transpointId}; STransMsg msg = {.info.handle = (void*)transpointId};
code = transAsyncSend(pThrd->asyncPool, &pCli->q); code = transAsyncSend(pThrd->asyncPool, &pCli->q);