fix: limit session num
This commit is contained in:
parent
b0116445e3
commit
97c4dfb570
|
@ -756,7 +756,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
|
|||
tsPrintAuth = cfgGetItem(pCfg, "printAuth")->bval;
|
||||
|
||||
tsNumOfRpcThreads = cfgGetItem(pCfg, "numOfRpcThreads")->i32;
|
||||
tsNumOfRpcSessions = cfgGetItem(pCfg, "numofrpcsessions")->i32;
|
||||
tsNumOfRpcSessions = cfgGetItem(pCfg, "numOfRpcSessions")->i32;
|
||||
tsTimeToGetAvailableConn = cfgGetItem(pCfg, "timeToGetAvailableConn")->i32;
|
||||
|
||||
tsNumOfCommitThreads = cfgGetItem(pCfg, "numOfCommitThreads")->i32;
|
||||
|
|
|
@ -93,15 +93,15 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) {
|
|||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
pDnode is null, TD-22618
|
||||
at trans.c line 91
|
||||
before this line, dmProcessRpcMsg callback is set
|
||||
after this line, parent is set
|
||||
so when dmProcessRpcMsg is called, pDonde is still null.
|
||||
*/
|
||||
if (pDnode != NULL){
|
||||
if(pDnode->status != DND_STAT_RUNNING) {
|
||||
/*
|
||||
pDnode is null, TD-22618
|
||||
at trans.c line 91
|
||||
before this line, dmProcessRpcMsg callback is set
|
||||
after this line, parent is set
|
||||
so when dmProcessRpcMsg is called, pDonde is still null.
|
||||
*/
|
||||
if (pDnode != NULL) {
|
||||
if (pDnode->status != DND_STAT_RUNNING) {
|
||||
if (pRpc->msgType == TDMT_DND_SERVER_STATUS) {
|
||||
dmProcessServerStartupStatus(pDnode, pRpc);
|
||||
return;
|
||||
|
|
|
@ -606,9 +606,8 @@ int32_t udfdLoadUdf(char *udfName, SUdf *udf) {
|
|||
}
|
||||
static bool udfdRpcRfp(int32_t code, tmsg_t msgType) {
|
||||
if (code == TSDB_CODE_RPC_NETWORK_UNAVAIL || code == TSDB_CODE_RPC_BROKEN_LINK || code == TSDB_CODE_SYN_NOT_LEADER ||
|
||||
code == TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED ||
|
||||
code == TSDB_CODE_SYN_RESTORING || code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING ||
|
||||
code == TSDB_CODE_APP_IS_STOPPING) {
|
||||
code == TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED || code == TSDB_CODE_SYN_RESTORING ||
|
||||
code == TSDB_CODE_MNODE_NOT_FOUND || code == TSDB_CODE_APP_IS_STARTING || code == TSDB_CODE_APP_IS_STOPPING) {
|
||||
if (msgType == TDMT_SCH_QUERY || msgType == TDMT_SCH_MERGE_QUERY || msgType == TDMT_SCH_FETCH ||
|
||||
msgType == TDMT_SCH_MERGE_FETCH) {
|
||||
return false;
|
||||
|
@ -673,6 +672,12 @@ int32_t udfdOpenClientRpc() {
|
|||
rpcInit.rfp = udfdRpcRfp;
|
||||
rpcInit.compressSize = tsCompressMsgSize;
|
||||
|
||||
int32_t connLimitNum = tsNumOfRpcSessions / (tsNumOfRpcThreads * 3);
|
||||
connLimitNum = TMAX(connLimitNum, 10);
|
||||
connLimitNum = TMIN(connLimitNum, 500);
|
||||
rpcInit.connLimitNum = connLimitNum;
|
||||
rpcInit.timeToGetConn = tsTimeToGetAvailableConn;
|
||||
|
||||
global.clientRpc = rpcOpen(&rpcInit);
|
||||
if (global.clientRpc == NULL) {
|
||||
fnError("failed to init dnode rpc client");
|
||||
|
@ -784,7 +789,7 @@ void udfdHandleRequest(SUdfdUvConn *conn) {
|
|||
|
||||
void udfdPipeCloseCb(uv_handle_t *pipe) {
|
||||
SUdfdUvConn *conn = pipe->data;
|
||||
SUvUdfWork* pWork = conn->pWorkList;
|
||||
SUvUdfWork *pWork = conn->pWorkList;
|
||||
while (pWork != NULL) {
|
||||
pWork->conn = NULL;
|
||||
pWork = pWork->pWorkNext;
|
||||
|
|
Loading…
Reference in New Issue