fix stream backend crash when transfer

This commit is contained in:
yihaoDeng 2023-12-18 11:19:15 +08:00
parent 5aa575acfa
commit 0840e6a0d8
1 changed files with 12 additions and 4 deletions

View File

@ -260,9 +260,17 @@ int32_t streamTaskSetDb(SStreamMeta* pMeta, void* arg, char* key) {
}
STaskDbWrapper* pBackend = taskDbOpen(pMeta->path, key, chkpId);
while (1) {
if (pBackend == NULL) {
taosThreadMutexUnlock(&pMeta->backendMutex);
return -1;
taosMsleep(1000);
stDebug("backed holded by other task, restart later, path: %s, key: %s", pMeta->path, key);
} else {
taosThreadMutexUnlock(&pMeta->backendMutex);
break;
}
taosThreadMutexLock(&pMeta->backendMutex);
pBackend = taskDbOpen(pMeta->path, key, chkpId);
}
int64_t tref = taosAddRef(taskDbWrapperId, pBackend);