You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/07/25 12:12:57 UTC

[GitHub] [incubator-brpc] 52coder opened a new issue, #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

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

   **Describe the bug (描述bug)**
   
   brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效
   
   **To Reproduce (复现方法)**
   connect_timeout_ms 默认设置  200ms
   下游服务timeout_ms 80ms,使用list配置下游ip
   ```
   "list://10.xxx.xxx.xxx:8105,10.xxx.xxx.xxx:8105"
   ```
   持续发送请求到下游服务,kill掉其中一台机器上的服务
   
   **Expected behavior (期望行为)**
   期望结果:不会触发熔断,两台机器都会有流量过来,服务这个时候失败率50%
   实际结果:触发熔断,被kill服务的机器没有流量。
   **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: dev-unsubscribe@brpc.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1202171840

   @wwbmmm 感谢,使用国外一台服务器验证这个连接超时成功,请教下,server端返回失败,就是设置cntl->SetFailed(xxx,"failed");然后brpc会自动根据失败率熔断吗?上午以为修改后验证没问题,刚看了下,发现还是不行。


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1198801610

   @wwbmmm 我理解错了,触发ECONNREFUSED 、ENETUNREACH、EHOSTUNREACH、EINVAL和连接超时是或的关系,我理解成并行了,请教下,如何构造连接超时呢?


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1201943199

   学习了熔断功能文档,看了相关代码,基于example的例子asynchronous_echo_c++修改后验证通过。


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1201943392

   @wwbmmm @cdjingit 感谢两位大佬


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] wwbmmm commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1202035059

   > @wwbmmm 用gdb attach上似乎构造不了连接超时
   
   确实不行,可以设置一个很小的connect_timeout_ms,比如1ms,然后client 和server分别在两个机房,这样构造连接超时试试


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1201178771

   @wwbmmm 多谢,可选熔断这个失败率怎么方便触发?改了example下的代码,不好构造呀,单测里有吗,没找到


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] cdjingit commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
cdjingit commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1201208964

   > @wwbmmm 多谢,可选熔断这个失败率怎么方便触发?改了example下的代码,不好构造呀,单测里有吗,没找到
   
   熔断功能使用文档:https://github.com/apache/incubator-brpc/blob/master/docs/cn/circuit_breaker.md#%E5%BC%80%E5%90%AF%E6%96%B9%E6%B3%95
   相关熔断触发阈值的gflag可以参考:https://github.com/apache/incubator-brpc/blob/master/src/brpc/circuit_breaker.cpp#L32


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] wwbmmm commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1197631153

   当ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时,connect_timeout_ms会被截断为timeout_ms的值,所以会导致connect timeout的发生。
   如果不希望因为connect timeout而导致熔断,可以把connect_timeout_ms设置成-1
   


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder closed issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder closed issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效
URL: https://github.com/apache/incubator-brpc/issues/1855


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] wwbmmm commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1198808183

   用gdb attach上server,使server暂停运行,但端口还是监听着的,这样应该就会连接超时


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1201994568

   @wwbmmm 用gdb attach上似乎构造不了连接超时


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] 52coder commented on issue #1855: brpc默认熔断ChannelOptions.timeout_ms < ChannelOptions.connect_timeout_ms时熔断生效

Posted by GitBox <gi...@apache.org>.
52coder commented on issue #1855:
URL: https://github.com/apache/incubator-brpc/issues/1855#issuecomment-1202188766

   @wwbmmm @cdjingit 大概看了下代码,Controller::Call::OnComplete---->FeedbackCircuitBreaker,再往前分析谁调用OnComplete有点多,业务要设置哪个错误码才会触发失败率熔断呢?


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org