chenBright commented on issue #1930: URL: https://github.com/apache/brpc/issues/1930#issuecomment-1521055179
> > 如果出现连续三次连接超时,brpc会把[连接超时作为网络不可达来处理](https://github.com/apache/incubator-brpc/blob/3e054ab3a521ed66eb19ff1dd124f6303cfad537/src/brpc/socket.cpp#L1358),进一步的对这个socket进行熔断。timeout 设置得过小时总是会先出发 rpc timeout,导致上面这段逻辑触发不了。 > > 如果代码执行了,那就是 err = ENETUNREACH; 那怎么触发的熔断呢,大佬能在帮忙解释一下吗 @dandyhuang 在rpc的OnComplete函数里判断error_code是ECONNREFUSED 、ENETUNREACH、EHOSTUNREACH、EINVAL其中一个,则将Socket SetFailed(熔断)。下次rpc就不会选中该Failed Socket。 -- 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]
