Copilot commented on code in PR #60411:
URL: https://github.com/apache/doris/pull/60411#discussion_r2751442264


##########
be/src/cloud/cloud_meta_mgr.cpp:
##########
@@ -1241,8 +1255,9 @@ Status 
CloudMetaMgr::_read_tablet_delete_bitmap_v2(CloudTablet* tablet, int64_t
             DeleteBitmapPB dbm = delete_bitmap_storages[i].delete_bitmap();
             RETURN_IF_ERROR(merge_delete_bitmap(rowset_id, dbm));
         } else {
-            auto submit_st = token->submit_func([&]() {
-                auto status = get_delete_bitmap_from_file(rowset_id);
+            const auto& storage = delete_bitmap_storages[i];
+            auto submit_st = token->submit_func([&, storage]() {

Review Comment:
   The lambda captures `rowset_id` by reference from the loop variable, which 
can lead to undefined behavior. The `rowset_id` reference will be invalid after 
the loop iteration completes or when it changes in the next iteration. Both 
`rowset_id` and `storage` should be captured by value in the lambda. Change the 
capture from `[&, storage]` to `[&, rowset_id, storage]` to explicitly capture 
`rowset_id` by value.
   ```suggestion
               auto submit_st = token->submit_func([&, rowset_id, storage]() {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to