From 8875863d07db3b9f13c92a259f60091306273f84 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 26 Jul 2024 23:43:36 +0800 Subject: [PATCH] fix:[TD-31017]process return value in client --- source/client/inc/clientInt.h | 2 +- source/client/src/clientEnv.c | 4 ++-- source/client/src/clientImpl.c | 4 ++-- source/client/src/clientMsgHandler.c | 36 ++++++++++++++-------------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/source/client/inc/clientInt.h b/source/client/inc/clientInt.h index 2fc43786e8..928afdaecf 100644 --- a/source/client/inc/clientInt.h +++ b/source/client/inc/clientInt.h @@ -207,7 +207,7 @@ typedef struct SReqResultInfo { } SReqResultInfo; typedef struct SRequestSendRecvBody { - tsem2_t rspSem; // not used now + tsem_t rspSem; // not used now __taos_async_fn_t queryFp; __taos_async_fn_t fetchFp; EQueryExecMode execMode; diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 7c3d7689e8..a16a779665 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -561,7 +561,7 @@ int32_t createRequest(uint64_t connId, int32_t type, int64_t reqid, SRequestObj goto _return; } (*pRequest)->msgBufLen = ERROR_MSG_BUF_DEFAULT_SIZE; - TSC_ERR_JRET(tsem2_init(&(*pRequest)->body.rspSem, 0, 0)); + TSC_ERR_JRET(tsem_init(&(*pRequest)->body.rspSem, 0, 0)); TSC_ERR_JRET(registerRequest(*pRequest, pTscObj)); return TSDB_CODE_SUCCESS; @@ -684,7 +684,7 @@ void doDestroyRequest(void *p) { taosMemoryFreeClear(pRequest->msgBuf); doFreeReqResultInfo(&pRequest->body.resInfo); - (void)tsem2_destroy(&pRequest->body.rspSem); + (void)tsem_destroy(&pRequest->body.rspSem); taosArrayDestroy(pRequest->tableList); taosArrayDestroy(pRequest->targetTableList); diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index b5220c7f37..6a981a7eb7 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -332,7 +332,7 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) { int64_t transporterId = 0; TSC_ERR_RET(asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &pMsgInfo->epSet, &transporterId, pSendMsg)); - (void)tsem2_wait(&pRequest->body.rspSem); + (void)tsem_wait(&pRequest->body.rspSem); return TSDB_CODE_SUCCESS; } @@ -1563,7 +1563,7 @@ int32_t taosConnectImpl(const char* user, const char* auth, const char* db, __ta tscError("failed to send connect msg to server, code:%s", tstrerror(code)); return code; } - (void)tsem2_wait(&pRequest->body.rspSem); + (void)tsem_wait(&pRequest->body.rspSem); if (pRequest->code != TSDB_CODE_SUCCESS) { const char* errorMsg = (code == TSDB_CODE_RPC_FQDN_ERROR) ? taos_errstr(pRequest) : tstrerror(pRequest->code); tscError("failed to connect to server, reason: %s", errorMsg); diff --git a/source/client/src/clientMsgHandler.c b/source/client/src/clientMsgHandler.c index 1e8c2720bf..e50399bf65 100644 --- a/source/client/src/clientMsgHandler.c +++ b/source/client/src/clientMsgHandler.c @@ -51,7 +51,7 @@ int32_t genericRspCallback(void* param, SDataBuf* pMsg, int32_t code) { if (pRequest->body.queryFp != NULL) { doRequestCallback(pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -64,7 +64,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { if (code != TSDB_CODE_SUCCESS) { setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } @@ -73,7 +73,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { if (NULL == pTscObj->pAppInfo) { code = TSDB_CODE_TSC_DISCONNECTED; setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } @@ -81,14 +81,14 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { if (tDeserializeSConnectRsp(pMsg->pData, pMsg->len, &connectRsp) != 0) { code = TSDB_CODE_TSC_INVALID_VERSION; setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } if ((code = taosCheckVersionCompatibleFromStr(version, connectRsp.sVer, 3)) != 0) { tscError("version not compatible. client version: %s, server version: %s", version, connectRsp.sVer); setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } @@ -98,14 +98,14 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { code = TSDB_CODE_TIME_UNSYNCED; tscError("time diff:%ds is too big", delta); setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } if (connectRsp.epSet.numOfEps == 0) { code = TSDB_CODE_APP_ERROR; setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } @@ -118,7 +118,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { dstEpSet.eps[dstEpSet.inUse].fqdn); if (code != 0){ setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } updateEpSet = 0; @@ -178,14 +178,14 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { code = hbRegisterConn(pAppHbMgr, pTscObj->id, connectRsp.clusterId, connectRsp.connType); if (code != 0){ setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } } else { taosThreadMutexUnlock(&clientHbMgr.lock); code = TSDB_CODE_TSC_DISCONNECTED; setErrno(pRequest, code); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); goto End; } taosThreadMutexUnlock(&clientHbMgr.lock); @@ -193,7 +193,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) { tscDebug("0x%" PRIx64 " clusterId:%" PRId64 ", totalConn:%" PRId64, pRequest->requestId, connectRsp.clusterId, pTscObj->pAppInfo->numOfConns); - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); End: if (pRequest) { @@ -256,7 +256,7 @@ int32_t processCreateDbRsp(void* param, SDataBuf* pMsg, int32_t code) { if (pRequest->body.queryFp) { doRequestCallback(pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -359,7 +359,7 @@ END: if (pRequest->body.queryFp != NULL) { doRequestCallback(pRequest, pRequest->code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -406,7 +406,7 @@ int32_t processCreateSTableRsp(void* param, SDataBuf* pMsg, int32_t code) { doRequestCallback(pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -459,7 +459,7 @@ END: if (pRequest->body.queryFp != NULL) { doRequestCallback(pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -502,7 +502,7 @@ int32_t processAlterStbRsp(void* param, SDataBuf* pMsg, int32_t code) { doRequestCallback(pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -637,7 +637,7 @@ int32_t processShowVariablesRsp(void* param, SDataBuf* pMsg, int32_t code) { if (pRequest->body.queryFp != NULL) { doRequestCallback(pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; } @@ -773,7 +773,7 @@ int32_t processCompactDbRsp(void* param, SDataBuf* pMsg, int32_t code) { if (pRequest->body.queryFp != NULL) { pRequest->body.queryFp(((SSyncQueryParam *)pRequest->body.interParam)->userParam, pRequest, code); } else { - (void)tsem2_post(&pRequest->body.rspSem); + (void)tsem_post(&pRequest->body.rspSem); } return code; }