HappenLee commented on code in PR #19847:
URL: https://github.com/apache/doris/pull/19847#discussion_r1198649009


##########
be/src/vec/sink/vdata_stream_sender.cpp:
##########
@@ -513,42 +553,72 @@ Status VDataStreamSender::send(RuntimeState* state, 
Block* block, bool eos) {
                         serialize_block(block, block_holder->get_block(), 
_channels.size()));
             }
 
-            for (auto channel : _channels) {
-                if (channel->is_local()) {
-                    RETURN_IF_ERROR(channel->send_local_block(block));
+            Status status;
+            for (auto it = _channels.begin(); it != _channels.end();) {
+                if ((*it)->is_local()) {
+                    status = (*it)->send_local_block(block);
                 } else {
                     SCOPED_CONSUME_MEM_TRACKER(_mem_tracker.get());
-                    RETURN_IF_ERROR(channel->send_block(block_holder, eos));
+                    status = (*it)->send_block(block_holder, eos);
                 }
+                if (status.is<ErrorCode::END_OF_FILE>()) {

Review Comment:
   ```
      if (status.is<ErrorCode::END_OF_FILE>()) {
                       it = _handle_oef_channel(state, it, status);
                       continue;
                   }
   ``` 
   the code repeat many time, better a function or #DEFINE



-- 
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