Merge pull request #12773 from taosdata/fix/dnode

fix: retry if no enough shm
This commit is contained in:
Shengliang Guan 2022-05-20 22:29:50 +08:00 committed by GitHub
commit 28e879f509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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);