提交 955b89f3 编写于 作者: S Shengliang Guan

rpc config

上级 e321edbe
...@@ -84,13 +84,7 @@ typedef struct SRpcInit { ...@@ -84,13 +84,7 @@ typedef struct SRpcInit {
void *parent; void *parent;
} SRpcInit; } SRpcInit;
typedef struct { int32_t rpcInit();
int32_t rpcTimer;
int32_t rpcMaxTime;
int32_t sver;
} SRpcCfg;
int32_t rpcInit(SRpcCfg *pCfg);
void rpcCleanup(); void rpcCleanup();
void *rpcOpen(const SRpcInit *pRpc); void *rpcOpen(const SRpcInit *pRpc);
void rpcClose(void *); void rpcClose(void *);
......
...@@ -225,11 +225,7 @@ void taos_init_imp(void) { ...@@ -225,11 +225,7 @@ void taos_init_imp(void) {
initMsgHandleFp(); initMsgHandleFp();
initQueryModuleMsgHandle(); initQueryModuleMsgHandle();
SRpcCfg rpcCfg = {0}; rpcInit();
rpcCfg.rpcTimer = cfgGetItem(tscCfg, "rpcTimer")->i32;
rpcCfg.rpcMaxTime = cfgGetItem(tscCfg, "rpcMaxTime")->i32;
rpcCfg.sver = 30000000;
rpcInit(&rpcCfg);
SCatalogCfg cfg = {.maxDBCacheNum = 100, .maxTblCacheNum = 100}; SCatalogCfg cfg = {.maxDBCacheNum = 100, .maxTblCacheNum = 100};
catalogInit(&cfg); catalogInit(&cfg);
......
...@@ -270,8 +270,7 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) { ...@@ -270,8 +270,7 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
taosBlockSIGPIPE(); taosBlockSIGPIPE();
taosResolveCRC(); taosResolveCRC();
SRpcCfg rpcCfg = {.rpcTimer = pCfg->rpcTimer, .rpcMaxTime = pCfg->rpcMaxTime, .sver = pCfg->sver}; if (rpcInit() != 0) {
if (rpcInit(&rpcCfg) != 0) {
dError("failed to init rpc since %s", terrstr()); dError("failed to init rpc since %s", terrstr());
dndCleanup(); dndCleanup();
return -1; return -1;
......
...@@ -42,8 +42,6 @@ int tsRpcMaxRetry; ...@@ -42,8 +42,6 @@ int tsRpcMaxRetry;
int tsRpcHeadSize; int tsRpcHeadSize;
int tsRpcOverhead; int tsRpcOverhead;
int32_t tsRpcForceTcp = 1; // disable this, means query, show command use udp protocol as default
SHashObj *tsFqdnHash; SHashObj *tsFqdnHash;
#ifndef USE_UV #ifndef USE_UV
...@@ -146,10 +144,6 @@ typedef struct SRpcConn { ...@@ -146,10 +144,6 @@ typedef struct SRpcConn {
static int tsRpcRefId = -1; static int tsRpcRefId = -1;
static int32_t tsRpcNum = 0; 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; // static pthread_once_t tsRpcInit = PTHREAD_ONCE_INIT;
// server:0 client:1 tcp:2 udp:0 // server:0 client:1 tcp:2 udp:0
...@@ -229,9 +223,7 @@ static void rpcInitImp(void) { ...@@ -229,9 +223,7 @@ static void rpcInitImp(void) {
tsFqdnHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); tsFqdnHash = taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
} }
int32_t rpcInit(SRpcCfg *pCfg) { int32_t rpcInit() {
tsRpcTimer = pCfg->rpcTimer;
tsRpcMaxTime = pCfg->rpcMaxTime;
pthread_once(&tsRpcInitOnce, rpcInitImp); pthread_once(&tsRpcInitOnce, rpcInitImp);
return 0; return 0;
} }
......
...@@ -112,7 +112,7 @@ void rpcSendRedirectRsp(void* thandle, const SEpSet* pEpSet) { ...@@ -112,7 +112,7 @@ void rpcSendRedirectRsp(void* thandle, const SEpSet* pEpSet) {
int rpcReportProgress(void* pConn, char* pCont, int contLen) { return -1; } int rpcReportProgress(void* pConn, char* pCont, int contLen) { return -1; }
void rpcCancelRequest(int64_t rid) { return; } void rpcCancelRequest(int64_t rid) { return; }
int32_t rpcInit(SRpcCfg* pCfg) { int32_t rpcInit() {
// impl later // impl later
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册