You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "BiteTheDDDDt (via GitHub)" <gi...@apache.org> on 2023/05/06 05:12:37 UTC

[GitHub] [doris] BiteTheDDDDt commented on a diff in pull request #19331: [bugfix](vectorization) fix data racing of VDataStreamRecvr

BiteTheDDDDt commented on code in PR #19331:
URL: https://github.com/apache/doris/pull/19331#discussion_r1186637931


##########
be/src/vec/runtime/vdata_stream_recvr.cpp:
##########
@@ -161,9 +162,11 @@ void VDataStreamRecvr::SenderQueue::add_block(const PBlock& pblock, int be_numbe
     COUNTER_UPDATE(_recvr->_deserialize_row_batch_timer, deserialize_time);
     COUNTER_UPDATE(_recvr->_decompress_timer, block->get_decompress_time());
     COUNTER_UPDATE(_recvr->_decompress_bytes, block->get_decompressed_bytes());
-
-    _block_queue.emplace_back(std::move(block), block_byte_size);
-    _update_block_queue_empty();
+    {
+        std::lock_guard<std::mutex> l(_lock);
+        _block_queue.emplace_back(std::move(block), block_byte_size);
+        _update_block_queue_empty_in_lock();

Review Comment:
   Maybe we can wrap this piece of code into a function
   ```
   lock
   push block to queue
   update emtpy flag
   ```



-- 
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-unsubscribe@doris.apache.org

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


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