From 8067febe277003033e112f33dcfce956b232a33f Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Thu, 13 Oct 2022 19:35:43 +0800 Subject: [PATCH] fix:sml core dump if insert quickly because of spin lock destroy --- source/client/src/clientSml.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientSml.c b/source/client/src/clientSml.c index 195466061d..bee5d085c8 100644 --- a/source/client/src/clientSml.c +++ b/source/client/src/clientSml.c @@ -2464,11 +2464,12 @@ static void smlInsertCallback(void *param, void *res, int32_t code) { }else{ pParam->request->body.resInfo.numOfRows += info->affectedRows; } + // unlock + taosThreadSpinUnlock(&pParam->lock); + if (pParam->cnt == pParam->total) { tsem_post(&pParam->sem); } - taosThreadSpinUnlock(&pParam->lock); - // unlock uDebug("SML:0x%" PRIx64 " insert finished, code: %d, rows: %d, total: %d", info->id, code, rows, info->affectedRows); info->cost.endTime = taosGetTimestampUs(); info->cost.code = code; -- GitLab