github-actions[bot] commented on code in PR #17287:
URL: https://github.com/apache/doris/pull/17287#discussion_r1121337617


##########
be/src/pipeline/exec/exchange_sink_buffer.cpp:
##########
@@ -197,53 +197,91 @@ Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
         return Status::OK();
     }
 
-#define DO_RPC(QUEUE, BLOCK, HOLDER)                                           
                    \
-    auto& request = QUEUE.front();                                             
                    \
-    if (!_instance_to_request[id]) {                                           
                    \
-        _construct_request(id);                                                
                    \
-    }                                                                          
                    \
-    auto brpc_request = _instance_to_request[id];                              
                    \
-    brpc_request->set_eos(request.eos);                                        
                    \
-    brpc_request->set_packet_seq(_instance_to_seq[id]++);                      
                    \
-    if (request.BLOCK) {                                                       
                    \
-        brpc_request->set_allocated_block(request.BLOCK);                      
                    \
-    }                                                                          
                    \
-    auto* _closure = new SelfDeleteClosure<PTransmitDataResult>(id, 
request.eos, HOLDER);          \
-    _closure->cntl.set_timeout_ms(request.channel->_brpc_timeout_ms);          
                    \
-    _closure->addFailedHandler(                                                
                    \
-            [&](const InstanceLoId& id, const std::string& err) { _failed(id, 
err); });            \
-    _closure->addSuccessHandler([&](const InstanceLoId& id, const bool& eos,   
                    \
-                                    const PTransmitDataResult& result) {       
                    \
-        Status s = Status(result.status());                                    
                    \
-        if (!s.ok()) {                                                         
                    \
-            _failed(id,                                                        
                    \
-                    fmt::format("exchange req success but status isn't ok: 
{}", s.to_string()));   \
-        } else if (eos) {                                                      
                    \
-            _ended(id);                                                        
                    \
-        } else {                                                               
                    \
-            _send_rpc(id);                                                     
                    \
-        }                                                                      
                    \
-    });                                                                        
                    \
-    {                                                                          
                    \
-        
SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER(ExecEnv::GetInstance()->orphan_mem_tracker());
    \
-        if (enable_http_send_block(*brpc_request)) {                           
                    \
-            RETURN_IF_ERROR(transmit_block_http(_context->get_runtime_state(), 
_closure,           \
-                                                *brpc_request, 
request.channel->_brpc_dest_addr)); \
-        } else {                                                               
                    \
-            transmit_block(*request.channel->_brpc_stub, _closure, 
*brpc_request);                 \
-        }                                                                      
                    \
-    }                                                                          
                    \
-    if (request.BLOCK) {                                                       
                    \
-        brpc_request->release_block();                                         
                    \
-    }                                                                          
                    \
-    QUEUE.pop();
-
     if (!q.empty()) {
         // If we have data to shuffle which is not broadcasted
-        DO_RPC(q, block.get(), nullptr)
+        auto& request = q.front();
+        if (!_instance_to_request[id]) {
+            _construct_request(id);
+        }
+        auto brpc_request = _instance_to_request[id];
+        brpc_request->set_eos(request.eos);
+        brpc_request->set_packet_seq(_instance_to_seq[id]++);
+        if (request.block) {

Review Comment:
   warning: redundant get() call on smart pointer 
[readability-redundant-smartptr-get]
   
   ```suggestion
           if (request.block) {
   ```
   



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