Merge pull request #17346 from taosdata/feature/TD-14761

fix:sml core dump if insert quickly because of spin lock destroy
This commit is contained in:
Shengliang Guan 2022-10-14 09:13:14 +08:00 committed by GitHub
commit 81e72ea84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -2477,11 +2477,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;