dandyhuang commented on issue #2146: URL: https://github.com/apache/brpc/issues/2146#issuecomment-1521102426
> > > > > > > 第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。 > > > > > > > > > > > > > > > > > > 试试重建channel的时候,设置不同的ChannelOptions::connection_group > > > > > > > > > > > > > > > 这个方法有效,我用了后,没有再出了 > > > > > > > > > > > > 这个是失败的时候,是将connection_group随便设置一个值吗 > > > > > > > > > 设置这个值的目的是让channel使用新的socket去连接server端,connection_group会参与SocketMap的key计算,只要保证每次重连的时候connection_group都设置一个不同的值就行,这样key就变了,新的channel就使用新的socket了 > > > > > > 嗯,一般程序启动后,channel->Init后,就会一直使用了,不会修改了。如果出错的话,channel能否知道。 还是只能通过rpc错误码来修改呢 > > 我用的是rpc错误码,只要rpc出错3次,不管什么错误码,我就把channel delete掉,重新设置 connection_group,重新channel->Init 这里有个要注意的地方就是channel->Init不是线程安全的,我加了锁 明白了,谢谢 -- 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