fix: trans mutex init

This commit is contained in:
kailixu 2023-10-17 11:12:52 +08:00
parent a30eedafec
commit 29c6daaff5
1 changed files with 2 additions and 0 deletions

View File

@ -472,6 +472,7 @@ void mndTransDropData(STrans *pTrans) {
pTrans->param = NULL; pTrans->param = NULL;
pTrans->paramLen = 0; pTrans->paramLen = 0;
} }
(void)taosThreadMutexDestroy(&pTrans->mutex);
} }
static int32_t mndTransDelete(SSdb *pSdb, STrans *pTrans, bool callFunc) { static int32_t mndTransDelete(SSdb *pSdb, STrans *pTrans, bool callFunc) {
@ -579,6 +580,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict,
pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo)); pTrans->pRpcArray = taosArrayInit(1, sizeof(SRpcHandleInfo));
pTrans->mTraceId = pReq ? TRACE_GET_ROOTID(&pReq->info.traceId) : tGenIdPI64(); pTrans->mTraceId = pReq ? TRACE_GET_ROOTID(&pReq->info.traceId) : tGenIdPI64();
taosInitRWLatch(&pTrans->lockRpcArray); taosInitRWLatch(&pTrans->lockRpcArray);
taosThreadMutexInit(&pTrans->mutex, NULL);
if (pTrans->redoActions == NULL || pTrans->undoActions == NULL || pTrans->commitActions == NULL || if (pTrans->redoActions == NULL || pTrans->undoActions == NULL || pTrans->commitActions == NULL ||
pTrans->pRpcArray == NULL) { pTrans->pRpcArray == NULL) {