From 17c4afe0c47a3100a8f2d1f8199ecc35b15a7a0b Mon Sep 17 00:00:00 2001 From: Jeff Tao Date: Mon, 1 Jun 2020 19:11:55 -0700 Subject: [PATCH] include user name in every packet change some debug info trace --- src/rpc/src/rpcMain.c | 8 ++++---- src/rpc/src/rpcTcp.c | 2 +- src/rpc/test/rserver.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 55b6be195b..978fc5b8ec 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -803,7 +803,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) { pConn = rpcGetConnObj(pRpc, sid, pRecv); if (pConn == NULL) { - tError("%s %p, failed to get connection obj(%s)", pRpc->label, pHead->ahandle, tstrerror(terrno)); + tTrace("%s %p, failed to get connection obj(%s)", pRpc->label, pHead->ahandle, tstrerror(terrno)); return NULL; } else { if (rpcIsReq(pHead->msgType)) { @@ -1100,7 +1100,7 @@ static void rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) { pHead->port = 0; pHead->linkUid = pConn->linkUid; pHead->ahandle = (uint64_t)pConn->ahandle; - if (!pConn->secured) memcpy(pHead->user, pConn->user, tListLen(pHead->user)); + memcpy(pHead->user, pConn->user, tListLen(pHead->user)); // set the connection parameters pConn->outType = msgType; @@ -1399,7 +1399,7 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) { code = TSDB_CODE_INVALID_TIME_STAMP; } else { if (rpcAuthenticateMsg(pHead, msgLen-TSDB_AUTH_LEN, pDigest->auth, pConn->secret) < 0) { - tError("%s, authentication failed, msg discarded", pConn->info); + tTrace("%s, authentication failed, msg discarded", pConn->info); code = TSDB_CODE_AUTH_FAILURE; } else { pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen) - sizeof(SRpcDigest); @@ -1408,7 +1408,7 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) { } } } else { - tError("%s, auth spi:%d not matched with received:%d", pConn->info, pConn->spi, pHead->spi); + tTrace("%s, auth spi:%d not matched with received:%d", pConn->info, pConn->spi, pHead->spi); code = pHead->spi ? TSDB_CODE_AUTH_FAILURE : TSDB_CODE_AUTH_REQUIRED; } diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index a7312fadf1..1e9b39414e 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -380,7 +380,7 @@ static void *taosProcessTcpData(void *param) { int32_t headLen = taosReadMsg(pFdObj->fd, &rpcHead, sizeof(SRpcHead)); if (headLen != sizeof(SRpcHead)) { - tError("%s %p, read error, headLen:%d", pThreadObj->label, pFdObj->thandle, headLen); + tTrace("%s %p, read error, headLen:%d", pThreadObj->label, pFdObj->thandle, headLen); taosReportBrokenLink(pFdObj); continue; } diff --git a/src/rpc/test/rserver.c b/src/rpc/test/rserver.c index f22fa35f52..4ce6a0a8cf 100644 --- a/src/rpc/test/rserver.c +++ b/src/rpc/test/rserver.c @@ -36,7 +36,7 @@ void processShellMsg() { while (1) { int numOfMsgs = taosReadAllQitems(qhandle, qall); if (numOfMsgs <= 0) { - usleep(1000); + usleep(100); continue; } -- GitLab