yiguolei commented on code in PR #47535:
URL: https://github.com/apache/doris/pull/47535#discussion_r1944110065


##########
be/src/pipeline/local_exchange/local_exchanger.cpp:
##########
@@ -189,11 +189,13 @@ Status ShuffleExchanger::get_block(RuntimeState* state, 
vectorized::Block* block
             const auto* offset_start = 
partitioned_block.second.row_idxs->data() +
                                        partitioned_block.second.offset_start;
             auto block_wrapper = partitioned_block.first;
-            RETURN_IF_ERROR(mutable_block.add_rows(&block_wrapper->data_block, 
offset_start,
-                                                   offset_start + 
partitioned_block.second.length));
+            // Make sure reference is already count down before wrapper 
de-constructed.
+            auto st = mutable_block.add_rows(&block_wrapper->data_block, 
offset_start,
+                                             offset_start + 
partitioned_block.second.length);
             block_wrapper->unref(

Review Comment:
   这么写也不对,假如add rows 里面比如申请内存抛异常,此时unref 也不会执行



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to