fix: retry 12 seconds if lock file failed
This commit is contained in:
parent
725baf4a7c
commit
ef00464f9c
|
@ -127,14 +127,24 @@ TdFilePtr dmCheckRunning(const char *dataDir) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ret = taosLockFile(pFile);
|
int32_t retryTimes = 0;
|
||||||
if (ret != 0) {
|
int32_t ret = 0;
|
||||||
|
do {
|
||||||
|
ret = taosLockFile(pFile);
|
||||||
|
if (ret == 0) break;
|
||||||
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
|
taosMsleep(100);
|
||||||
|
retryTimes++;
|
||||||
|
dError("failed to lock file:%s since %s, retryTimes:%d", filepath, terrstr(), retryTimes);
|
||||||
|
} while (retryTimes < 120);
|
||||||
|
|
||||||
|
if (ret < 0) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
dError("failed to lock file:%s since %s", filepath, terrstr());
|
|
||||||
taosCloseFile(&pFile);
|
taosCloseFile(&pFile);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
terrno = 0;
|
||||||
dDebug("lock file:%s to prevent repeated starts", filepath);
|
dDebug("lock file:%s to prevent repeated starts", filepath);
|
||||||
return pFile;
|
return pFile;
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,6 @@ if $data(1)[3] != dropping then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step9: start mnode1 and wait it dropped
|
print =============== step9: start mnode1 and wait it dropped
|
||||||
sleep 3000
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
|
Loading…
Reference in New Issue