From 3070d2d455abf0efe1724f86b89f9341ad14d6ad Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Tue, 21 Jan 2025 12:34:47 +0800 Subject: [PATCH] Fix merge code error. --- source/util/src/tqueue.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/util/src/tqueue.c b/source/util/src/tqueue.c index 1e42ac1d86..db75c6b2ff 100644 --- a/source/util/src/tqueue.c +++ b/source/util/src/tqueue.c @@ -166,18 +166,18 @@ int32_t taosAllocateQitem(int32_t size, EQItype itype, int64_t dataSize, void ** uDebug("failed to alloc qitem, size:%" PRId64 " alloc:%" PRId64 " allowed:%" PRId64, size + dataSize, alloced, tsApplyMemoryAllowed); (void)atomic_sub_fetch_64(&tsApplyMemoryUsed, size + dataSize); - terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE; return (terrno = TSDB_CODE_OUT_OF_RPC_MEMORY_QUEUE); } } *item = NULL; STaosQnode *pNode = taosMemoryCalloc(1, sizeof(STaosQnode) + size); - if (itype == RPC_QITEM) { - (void)atomic_sub_fetch_64(&tsQueueMemoryUsed, size + dataSize); - return terrno; - } else if (itype == APPLY_QITEM) { - (void)atomic_sub_fetch_64(&tsApplyMemoryUsed, size + dataSize); + if (pNode == NULL) { + if (itype == RPC_QITEM) { + (void)atomic_sub_fetch_64(&tsQueueMemoryUsed, size + dataSize); + } else if (itype == APPLY_QITEM) { + (void)atomic_sub_fetch_64(&tsApplyMemoryUsed, size + dataSize); + } return terrno; }