52coder opened a new issue, #1870:
URL: https://github.com/apache/incubator-brpc/issues/1870

   **Describe the bug (描述bug)**
   基于example中的例子验证可选熔断(根据失败率)
   
原始代码:https://github.com/52coder/incubator-brpc/tree/master/example/asynchronous_echo_c%2B%2B
   client.cpp代码修改点:
   
https://github.com/52coder/incubator-brpc/blob/master/example/asynchronous_echo_c%2B%2B/client.cpp#L65后添加:
   options.enable_circuit_breaker = true;
   L30行修改为rr :
   DEFINE_string(load_balancer, "rr", "The algorithm for load balancing");
   
   
server.cpp中未改动,先编译出来echo_server,然后在https://github.com/52coder/incubator-brpc/blob/master/example/asynchronous_echo_c%2B%2B/server.cpp#L63前面增加如下代码:
   cntl->SetFailed(brpc::EREQUEST, "Fail to parse 
request");然后编译出二进制echo_server_fail
   
   这里的想法是先构造一个100%失败的server触发熔断。
   
   **To Reproduce (复现方法)**
   验证方法,三个终端下分别执行
   ./echo_server  --port=8001  
   ./echo_server  --port=8002 
   ./echo_server_fail  --port=8003 
   
   client端运行:
   ./echo_client 
--server="list://192.168.49.1:8001,192.168.49.1:8002,192.168.49.1:8003"
   
   **Expected behavior (期望行为)**
   期望行为是由于client端开启了熔断,其中一个server一直返回失败,所以应该会触发熔断才对,实际结果是跑了一晚上,一直出错的那个server并未摘除
   `
   I0803 00:26:21.137101 1872894 client.cpp:45] Received response from 
192.168.49.1:8002: hello world (attached=bar) latency=603us
   I0803 00:26:22.137842 1872886 client.cpp:45] Received response from 
192.168.49.1:8003: hello world (attached=bar) latency=734us
   W0803 00:26:23.138861 1872894 client.cpp:42] Fail to send EchoRequest, 
[E1003][127.0.1.1:8001][E1003]Fail to parse request
   I0803 00:26:24.139042 1872886 client.cpp:45] Received response from 
192.168.49.1:8002: hello world (attached=bar) latency=590us
   I0803 00:26:25.139412 1872894 client.cpp:45] Received response from 
192.168.49.1:8003: hello world (attached=bar) latency=639us
   W0803 00:26:26.140028 1872886 client.cpp:42] Fail to send EchoRequest, 
[E1003][127.0.1.1:8001][E1003]Fail to parse request
   I0803 00:26:27.140468 1872894 client.cpp:45] Received response from 
192.168.49.1:8002: hello world (attached=bar) latency=733us
   I0803 00:26:28.141491 1872886 client.cpp:45] Received response from 
192.168.49.1:8003: hello world (attached=bar) latency=739us
   W0803 00:26:29.142124 1872894 client.cpp:42] Fail to send EchoRequest, 
[E1003][127.0.1.1:8001][E1003]Fail to parse request
   I0803 00:26:30.142181 1872886 client.cpp:45] Received response from 
192.168.49.1:8002: hello world (attached=bar) latency=484us
   I0803 00:26:31.142817 1872894 client.cpp:45] Received response from 
192.168.49.1:8003: hello world (attached=bar) latency=737us
   W0803 00:26:32.143875 1872886 client.cpp:42] Fail to send EchoRequest, 
[E1003][127.0.1.1:8001][E1003]Fail to parse request
   I0803 00:26:33.144834 1872894 client.cpp:45] Received response from 
192.168.49.1:8002: hello world (attached=bar) latency=748us
   I0803 00:26:34.145134 1872886 client.cpp:45] Received response from 
192.168.49.1:8003: hello world (attached=bar) latency=676us
   W0803 00:26:35.145437 1872894 client.cpp:42] Fail to send EchoRequest, 
[E1003][127.0.1.1:8001][E1003]Fail to parse request
   I0803 00:26:36.145931 1872886 client.cpp:45] Received response from 
192.168.49.1:8002: hello world (attached=bar) latency=739us
   `
   
   **Versions (各种版本)**
   OS:
   Compiler:
   brpc:
   protobuf:
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


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