fix stream backend crash when transfer
This commit is contained in:
parent
5aa575acfa
commit
0840e6a0d8
|
@ -260,9 +260,17 @@ int32_t streamTaskSetDb(SStreamMeta* pMeta, void* arg, char* key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
STaskDbWrapper* pBackend = taskDbOpen(pMeta->path, key, chkpId);
|
STaskDbWrapper* pBackend = taskDbOpen(pMeta->path, key, chkpId);
|
||||||
|
while (1) {
|
||||||
if (pBackend == NULL) {
|
if (pBackend == NULL) {
|
||||||
taosThreadMutexUnlock(&pMeta->backendMutex);
|
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);
|
int64_t tref = taosAddRef(taskDbWrapperId, pBackend);
|
||||||
|
|
Loading…
Reference in New Issue