fix: possible race condition coredump
This commit is contained in:
parent
9a4222e189
commit
44866b7b12
|
@ -1186,11 +1186,6 @@ const char *gFSBgTaskName[] = {NULL, "MERGE", "RETENTION", "COMPACT"};
|
||||||
static int32_t tsdbFSRunBgTask(void *arg) {
|
static int32_t tsdbFSRunBgTask(void *arg) {
|
||||||
STFSBgTask *task = (STFSBgTask *)arg;
|
STFSBgTask *task = (STFSBgTask *)arg;
|
||||||
STFileSystem *fs = task->fs;
|
STFileSystem *fs = task->fs;
|
||||||
STFileSet *fset;
|
|
||||||
|
|
||||||
tsdbFSGetFSet(fs, task->fid, &fset);
|
|
||||||
|
|
||||||
ASSERT(fset != NULL && fset->bgTaskRunning == task);
|
|
||||||
|
|
||||||
task->launchTime = taosGetTimestampMs();
|
task->launchTime = taosGetTimestampMs();
|
||||||
task->run(task->arg);
|
task->run(task->arg);
|
||||||
|
@ -1203,6 +1198,10 @@ static int32_t tsdbFSRunBgTask(void *arg) {
|
||||||
|
|
||||||
taosThreadMutexLock(&fs->tsdb->mutex);
|
taosThreadMutexLock(&fs->tsdb->mutex);
|
||||||
|
|
||||||
|
STFileSet *fset = NULL;
|
||||||
|
tsdbFSGetFSet(fs, task->fid, &fset);
|
||||||
|
ASSERT(fset != NULL && fset->bgTaskRunning == task);
|
||||||
|
|
||||||
// free last
|
// free last
|
||||||
tsdbDoDoneBgTask(fs, task);
|
tsdbDoDoneBgTask(fs, task);
|
||||||
fset->bgTaskRunning = NULL;
|
fset->bgTaskRunning = NULL;
|
||||||
|
|
Loading…
Reference in New Issue