diff --git a/src/sync/src/syncMain.c b/src/sync/src/syncMain.c index 68bafb09ca82a7a55b8eb3cd94c24138f5ef3a6c..a8b5a8f403cb9ca0c897d77db280e5a331c1f32e 100644 --- a/src/sync/src/syncMain.c +++ b/src/sync/src/syncMain.c @@ -1502,7 +1502,10 @@ static int32_t syncForwardToPeerImpl(SSyncNode *pNode, void *data, void *mhandle } } - int32_t retLen = taosWriteMsg(pPeer->peerFd, pSyncHead, fwdLen); + SOCKET peerFd = pPeer->peerFd; + pthread_mutex_unlock(&pNode->mutex); + int32_t retLen = taosWriteMsg(peerFd, pSyncHead, fwdLen); + pthread_mutex_lock(&pNode->mutex); if (retLen == fwdLen) { sTrace("%s, forward is sent, role:%s sstatus:%s hver:%" PRIu64 " contLen:%d", pPeer->id, syncRole[pPeer->role], syncStatus[pPeer->sstatus], pWalHead->version, pWalHead->len);