From 646cb378ae01915fd90c3df0fdf2ec61909185f9 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 12 Aug 2022 17:35:08 +0800 Subject: [PATCH] fix: deadlock of vnode if its state changed --- source/dnode/vnode/src/vnd/vnodeOpen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/dnode/vnode/src/vnd/vnodeOpen.c b/source/dnode/vnode/src/vnd/vnodeOpen.c index 4ee5c4760c..a4fd984fb7 100644 --- a/source/dnode/vnode/src/vnd/vnodeOpen.c +++ b/source/dnode/vnode/src/vnd/vnodeOpen.c @@ -85,7 +85,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) { pVnode->state.commitTerm = info.state.commitTerm; pVnode->pTfs = pTfs; pVnode->msgCb = msgCb; - taosInitRWLatch(&pVnode->lock); + taosThreadMutexInit(&pVnode->lock, NULL); pVnode->blocked = false; tsem_init(&pVnode->syncSem, 0, 0); @@ -200,6 +200,7 @@ void vnodeClose(SVnode *pVnode) { tsem_destroy(&pVnode->syncSem); taosThreadCondDestroy(&pVnode->poolNotEmpty); taosThreadMutexDestroy(&pVnode->mutex); + taosThreadMutexDestroy(&pVnode->lock); taosMemoryFree(pVnode); } } -- GitLab