hjwsm1989 commented on code in PR #3359:
URL: https://github.com/apache/brpc/pull/3359#discussion_r3485828957


##########
src/brpc/selective_channel.cpp:
##########
@@ -571,7 +581,8 @@ void SelectiveChannel::CallMethod(
         cntl->SetFailed(EINVAL, "SelectiveChannel=%p is not initialized yet",
                         this);
     }
-    schan::Sender* sndr = new schan::Sender(cntl, request, response, 
user_done);
+    schan::Sender* sndr =

Review Comment:
   Addressed. `SelectiveChannel::CallMethod()` now returns immediately when the 
channel is not initialized, and runs `done` in-place if provided, matching the 
behavior of `PartitionChannel`.
   
   This avoids allocating `Sender` or dispatching into the inner channel with 
an unavailable balancer. I also added a regression test covering both sync and 
async uninitialized calls.



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