diff --git a/include/libs/transport/trpc.h b/include/libs/transport/trpc.h index befd309582bb6452c5475c97387a5a89fffdf7e3..5e3860822ec161ef52eece2931b7c71dee4fb40d 100644 --- a/include/libs/transport/trpc.h +++ b/include/libs/transport/trpc.h @@ -84,13 +84,7 @@ typedef struct SRpcInit { void *parent; } SRpcInit; -typedef struct { - int32_t rpcTimer; - int32_t rpcMaxTime; - int32_t sver; -} SRpcCfg; - -int32_t rpcInit(SRpcCfg *pCfg); +int32_t rpcInit(); void rpcCleanup(); void *rpcOpen(const SRpcInit *pRpc); void rpcClose(void *); diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index f07048efbc0ed151ca63dbe782626d7078105a37..c8b0785a3a43ab14387eca524bda947399bc0c7d 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -225,11 +225,7 @@ void taos_init_imp(void) { initMsgHandleFp(); initQueryModuleMsgHandle(); - SRpcCfg rpcCfg = {0}; - rpcCfg.rpcTimer = cfgGetItem(tscCfg, "rpcTimer")->i32; - rpcCfg.rpcMaxTime = cfgGetItem(tscCfg, "rpcMaxTime")->i32; - rpcCfg.sver = 30000000; - rpcInit(&rpcCfg); + rpcInit(); SCatalogCfg cfg = {.maxDBCacheNum = 100, .maxTblCacheNum = 100}; catalogInit(&cfg); diff --git a/source/dnode/mgmt/impl/src/dndEnv.c b/source/dnode/mgmt/impl/src/dndEnv.c index 7c45474be4c423c1f07b687c274ffdb47e69c5fc..510ffbfdbf6cd241cae3a27b8fc36a6e1b253ae3 100644 --- a/source/dnode/mgmt/impl/src/dndEnv.c +++ b/source/dnode/mgmt/impl/src/dndEnv.c @@ -270,8 +270,7 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) { taosBlockSIGPIPE(); taosResolveCRC(); - SRpcCfg rpcCfg = {.rpcTimer = pCfg->rpcTimer, .rpcMaxTime = pCfg->rpcMaxTime, .sver = pCfg->sver}; - if (rpcInit(&rpcCfg) != 0) { + if (rpcInit() != 0) { dError("failed to init rpc since %s", terrstr()); dndCleanup(); return -1; diff --git a/source/libs/transport/src/rpcMain.c b/source/libs/transport/src/rpcMain.c index cfd01bf3be7c4b0256dde3a3669b88dbaf69fb40..e1319da1624b0b32c9cd0e987768e0ea8e66e022 100644 --- a/source/libs/transport/src/rpcMain.c +++ b/source/libs/transport/src/rpcMain.c @@ -42,8 +42,6 @@ int tsRpcMaxRetry; int tsRpcHeadSize; int tsRpcOverhead; -int32_t tsRpcForceTcp = 1; // disable this, means query, show command use udp protocol as default - SHashObj *tsFqdnHash; #ifndef USE_UV @@ -146,10 +144,6 @@ typedef struct SRpcConn { static int tsRpcRefId = -1; static int32_t tsRpcNum = 0; -int32_t tsRpcTimer = 300; -int32_t tsRpcMaxTime = 600; // seconds; -uint32_t tsVersion = 0; - // static pthread_once_t tsRpcInit = PTHREAD_ONCE_INIT; // server:0 client:1 tcp:2 udp:0 @@ -229,9 +223,7 @@ static void rpcInitImp(void) { tsFqdnHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); } -int32_t rpcInit(SRpcCfg *pCfg) { - tsRpcTimer = pCfg->rpcTimer; - tsRpcMaxTime = pCfg->rpcMaxTime; +int32_t rpcInit() { pthread_once(&tsRpcInitOnce, rpcInitImp); return 0; } diff --git a/source/libs/transport/src/trans.c b/source/libs/transport/src/trans.c index 09aee6c8bcad1255173f9912ff1ddb83e4fab02a..b45683617f6343f5df79fb85e95e44aac3a8c056 100644 --- a/source/libs/transport/src/trans.c +++ b/source/libs/transport/src/trans.c @@ -112,7 +112,7 @@ void rpcSendRedirectRsp(void* thandle, const SEpSet* pEpSet) { int rpcReportProgress(void* pConn, char* pCont, int contLen) { return -1; } void rpcCancelRequest(int64_t rid) { return; } -int32_t rpcInit(SRpcCfg* pCfg) { +int32_t rpcInit() { // impl later return 0; }