chenBright commented on PR #2177: URL: https://github.com/apache/brpc/pull/2177#issuecomment-2764637743
> 好像从已有的Failed的Socket上也能够获取到EndPoint字段? 可以使用AddressFailedAsWell。 > 需要区分Socket的连接状态和屏蔽状态,LB看的是屏蔽状态,实际连接的时候,再看连接状态,如果连接状态是Failed时再启动备用连接之类的。 目前LB将会屏蔽Failed连接状态的Socket,除此之外,还会屏蔽ExcludedServers和Socket::IsAvailable(目前只有logff是unavailable)的Socket。 bRPC的恐慌策略可以这样设计:**保持LB屏蔽策略不变**,当LB选不出实例的时候,不返回E112,而是使用第一次选到实例的信息构造出一个备用Socket用于通信。在E112期间,负载均衡也是生效的,开销也比较小,只是多一次创建Socket的开销,这个Socket在恐慌周期内是可以复用的,完全可接受。 跟Envoy的可调整的恐慌阈值不同,bRPC的恐慌阈值为100%,是这样考虑的:虽然Envoy区分连接状态和屏蔽状态,但是在LB处只看到屏蔽状态。触发恐慌的时候(阈值小于100%),会跟一些完全不可用的实例通信(连接错误码是ECONNREFUSED、ENETUNREACH、EHOSTUNREACH),这是没有意义,会浪费一次通信机会。 @wwbmmm 有什么建议吗? -- 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-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org