diff --git a/be/src/exec/schema_scanner.cpp b/be/src/exec/schema_scanner.cpp index 85199f2a0be6f6..5892b064c52b9b 100644 --- a/be/src/exec/schema_scanner.cpp +++ b/be/src/exec/schema_scanner.cpp @@ -119,12 +119,12 @@ Status SchemaScanner::get_next_block_async(RuntimeState* state) { auto task_ctx = state->get_task_execution_context(); RETURN_IF_ERROR(ExecEnv::GetInstance()->fragment_mgr()->get_thread_pool()->submit_func( [this, task_ctx, state]() { - DCHECK(_async_thread_running == false); auto task_lock = task_ctx.lock(); if (task_lock == nullptr) { _scanner_status.update(Status::InternalError("Task context not exists!")); return; } + DCHECK(_async_thread_running == false); SCOPED_ATTACH_TASK(state); _dependency->block(); _async_thread_running = true;