From 37ebab8cd2fbb50ecfda889783cea91c3a834495 Mon Sep 17 00:00:00 2001 From: z404289981 <123865460+z404289981@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:21:19 +0800 Subject: [PATCH] [fix]fix be core when migration tablet to other disk (#37712) ![image](https://github.com/user-attachments/assets/01f67160-3ebe-41a1-ac79-a7173d14605c) The asynchronous task reference captures a local variable ## Proposed changes Issue Number: close #36809 Co-authored-by: huronghui --- be/src/http/action/tablet_migration_action.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/http/action/tablet_migration_action.cpp b/be/src/http/action/tablet_migration_action.cpp index 3d5b40ae186624..b0594c7fef6a34 100644 --- a/be/src/http/action/tablet_migration_action.cpp +++ b/be/src/http/action/tablet_migration_action.cpp @@ -73,7 +73,8 @@ void TabletMigrationAction::handle(HttpRequest* req) { } _migration_tasks[current_task] = "submitted"; } - auto st = _migration_thread_pool->submit_func([&, dest_disk, current_task]() { + auto st = _migration_thread_pool->submit_func([&, tablet, dest_store, + current_task]() { { std::unique_lock lock(_migration_status_mutex); _migration_tasks[current_task] = "running";