From 131bf46854b1afdc01185c6a483efe3d60376b26 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Sat, 2 Apr 2022 10:51:46 +0800 Subject: [PATCH] [TD-13756]: log file open fail error. --- source/util/src/tlog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 11e6edf022..fe02070bcb 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -353,7 +353,9 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) { printf("\nfailed to open log file:%s, reason:%s\n", fileName, strerror(errno)); return -1; } - taosCloseFile(&tsLogObj.logHandle->pFile); + TdFilePtr pOldFile = tsLogObj.logHandle->pFile; + taosUnLockLogFile(pOldFile); + taosCloseFile(&pOldFile); tsLogObj.logHandle->pFile = pFile; taosLockLogFile(tsLogObj.logHandle->pFile); -- GitLab