From ccbcdbad1968661dcf353a21d47d3fd22ca15704 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 20 May 2022 21:53:56 +0800 Subject: [PATCH] fix: retry if no enough shm --- source/dnode/mgmt/node_mgmt/src/dmProc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmProc.c b/source/dnode/mgmt/node_mgmt/src/dmProc.c index de58366fe6..d044ad3b2e 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmProc.c +++ b/source/dnode/mgmt/node_mgmt/src/dmProc.c @@ -96,6 +96,11 @@ static inline int32_t dmPushToProcQueue(SProc *proc, SProcQueue *queue, SRpcMsg const int32_t fullLen = headLen + bodyLen + 8; const int64_t handle = (int64_t)pMsg->info.handle; + if (fullLen > queue->total) { + terrno = TSDB_CODE_OUT_OF_RANGE; + return -1; + } + taosThreadMutexLock(&queue->mutex); if (fullLen > queue->avail) { taosThreadMutexUnlock(&queue->mutex); @@ -448,7 +453,7 @@ void dmPutToProcPQueue(SProc *proc, SRpcMsg *pMsg, EProcFuncType ftype) { break; } - if (retry == 10) { + if (terrno != TSDB_CODE_OUT_OF_SHM_MEM) { pMsg->code = terrno; if (pMsg->contLen > 0) { rpcFreeCont(pMsg->pCont); -- GitLab