You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "netjia-cpu (via GitHub)" <gi...@apache.org> on 2023/03/03 12:32:19 UTC

[I] brpc故障恢复 (brpc)

netjia-cpu opened a new issue, #2146:
URL: https://github.com/apache/brpc/issues/2146

   注入网络重启故障 network restart,brpc channel发送rpc request一直超时
   日志一直打印:[E112]Not connected to xxxx yet
   
   对应代码位于:Controller::IssueRPC
   ![image](https://user-images.githubusercontent.com/13553842/222721053-adef5162-f6db-46c9-8774-25c056b248b8.png)
   
   
   brpc版本:0.9.7
   
   bvar看channel是broken的,这样导致brpc一直无法自动恢复。有点像是socket管理的bug,broken的channel没用调用connect重连
   
   


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "jialei-jialei (via GitHub)" <gi...@apache.org>.
jialei-jialei commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-2021835826

   > 这个问题最终解决了吗?遇到问题修改connection_group不是最终方案吧。
   
   下面的这个commit解决了吗


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1499837221

   > 
   > 第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。
   
   试试重建channel的时候,设置不同的ChannelOptions::connection_group


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "trevor211 (via GitHub)" <gi...@apache.org>.
trevor211 commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1504796017

   > > > 我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了
   > > 
   > > 
   > > 请问你们网络故障注入的具体流程是怎样的,每次网络注入故障多久后恢复?
   > 
   > 我们是bond4组网,ifconfig down/up bond的其中一个网口,注入故障10s内随机,一直循环10几个小时,最后恢复
   
   请问在你们的环境中,大概多久能够复现呢?


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1521072998

   > > > > 第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。
   > > > 
   > > > 
   > > > 试试重建channel的时候,设置不同的ChannelOptions::connection_group
   > > 
   > > 
   > > 这个方法有效,我用了后,没有再出了
   > 
   > 这个是失败的时候,是将connection_group随便设置一个值吗
   
   设置这个值的目的是让channel使用新的socket去连接server端,connection_group会参与SocketMap的key计算,只要保证每次重连的时候connection_group都设置一个不同的值就行,这样key就变了,新的channel就使用新的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: 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


Re: [I] brpc故障恢复bug (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1707755999

   这个问题最终解决了吗?遇到问题修改connection_group不是最终方案吧。


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-2029053055

   开启keepalive功能能解决吗?https://github.com/apache/brpc/pull/2098


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1455776609

   > @netjia-cpu 可以尝试打 #1817 这个patch试下 ,或者升级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


Re: [I] brpc故障恢复bug (brpc)

Posted by "lorinlee (via GitHub)" <gi...@apache.org>.
lorinlee commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1454693957

   @netjia-cpu 可以尝试打 #1817  这个patch试下 ,或者升级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


Re: [I] brpc故障恢复bug (brpc)

Posted by "dandyhuang (via GitHub)" <gi...@apache.org>.
dandyhuang commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1519821955

   > > > 第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。
   > > 
   > > 
   > > 试试重建channel的时候,设置不同的ChannelOptions::connection_group
   > 
   > 这个方法有效,我用了后,没有再出了
   
   这个是失败的时候,是将connection_group随便设置一个值吗
   


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "dandyhuang (via GitHub)" <gi...@apache.org>.
dandyhuang commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1521088625

   > > > > > 第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。
   > > > > 
   > > > > 
   > > > > 试试重建channel的时候,设置不同的ChannelOptions::connection_group
   > > > 
   > > > 
   > > > 这个方法有效,我用了后,没有再出了
   > > 
   > > 
   > > 这个是失败的时候,是将connection_group随便设置一个值吗
   > 
   > 设置这个值的目的是让channel使用新的socket去连接server端,connection_group会参与SocketMap的key计算,只要保证每次重连的时候connection_group都设置一个不同的值就行,这样key就变了,新的channel就使用新的socket了
   
   嗯,一般程序启动后,channel->Init后,就会一直使用了,不会修改了。如果出错的话,channel能否知道。 还是只能通过rpc错误码来修改呢


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1485044876

   这个问题对目前的业务影响很大,比较头疼。我想到的办法是:
   1.放弃使用brpc,改用grpc,但是grpc没brpc好,c++的grpc太臃肿了
   2.改源码,把Socket类改写掉,去掉那一堆复杂的原子计数,用最简单的方式实现
   3.应用层规避,brpc持续出现这个错误码,进程就自杀(把channel delete掉,重连,不知道是否有效果)


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1504833117

   > > > > 我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了
   > > > 
   > > > 
   > > > 请问你们网络故障注入的具体流程是怎样的,每次网络注入故障多久后恢复?
   > > 
   > > 
   > > 我们是bond4组网,ifconfig down/up bond的其中一个网口,注入故障10s内随机,一直循环10几个小时,最后恢复
   > 
   > 请问在你们的环境中,大概多久能够复现呢?
   
   一般来说,这样的故障跑一个晚上,第二天早上看,brpc基本会出问题。最快的时候见过,1-2个小时就出了


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "jialei-jialei (via GitHub)" <gi...@apache.org>.
jialei-jialei commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-2021834452

   connection_group没能底层规避,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


Re: [I] brpc故障恢复bug (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-2021849328

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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1504379860

   > > 第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。
   > 
   > 试试重建channel的时候,设置不同的ChannelOptions::connection_group
   
   这个方法有效,我用了后,没有再出了


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "trevor211 (via GitHub)" <gi...@apache.org>.
trevor211 commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1504489670

   > 我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了
   
   请问你们网络故障注入的具体流程是怎样的,每次网络注入故障多久后恢复?


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1521100393

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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1485045503

   这个问题对目前的业务影响很大,比较头疼。我想到的办法是:
   1.放弃使用brpc,改用grpc,但是grpc没brpc好,c++的grpc太臃肿了
   2.改源码,把Socket类改写掉,去掉那一堆复杂的原子计数,用最简单的方式实现
   3.应用层规避,brpc持续出现这个错误码,进程就自杀(把channel delete掉,重连,不知道是否有效果)


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1485037941

   我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "trevor211 (via GitHub)" <gi...@apache.org>.
trevor211 commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1476020080

   请问“网络重启故障”具体是指什么呢?是如何注入的?我们也遇到了这个问题,client一直返回E112,直到重启才恢复,持续时间最长的client大约是40分钟。


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "Huixxi (via GitHub)" <gi...@apache.org>.
Huixxi commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1495319116

   > 这个问题对目前的业务影响很大,比较头疼。我想到的办法是: 1.放弃使用brpc,改用grpc,但是grpc没brpc好,c++的grpc太臃肿了 2.改源码,把Socket类改写掉,去掉那一堆复杂的原子计数,用最简单的方式实现 3.应用层规避,brpc持续出现这个错误码,进程就自杀(把channel delete掉,重连,不知道是否有效果)
   
   问下现在连接类型是什么?短链接、长连接or连接池


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "trevor211 (via GitHub)" <gi...@apache.org>.
trevor211 commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1505114580

   > > > > > 我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了
   > > > > 
   > > > > 
   > > > > 请问你们网络故障注入的具体流程是怎样的,每次网络注入故障多久后恢复?
   > > > 
   > > > 
   > > > 我们是bond4组网,ifconfig down/up bond的其中一个网口,注入故障10s内随机,一直循环10几个小时,最后恢复
   > > 
   > > 
   > > 请问在你们的环境中,大概多久能够复现呢?
   > 
   > 一般来说,这样的故障跑一个晚上,第二天早上看,brpc基本会出问题。最快的时候见过,1-2个小时就出了。 复现的时候还见过除了E112以外的错误,E1008,一直返回超时,抓包看,没有包发到server端,bvar看connection是残缺的,2天都没自动恢复,所以我猜也是处于假死状态
   
   请问你们的环境中,ifconfig up bond之后立即就进行下一轮的ifconfig down bond了吗?还是等待了一段时间呢?如果等待,等了多久呢?


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1504526525

   > > 我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了
   > 
   > 请问你们网络故障注入的具体流程是怎样的,每次网络注入故障多久后恢复?
   
   我们是bond4组网,ifconfig down/up bond的其中一个网口,注入故障10s内随机,一直循环10几个小时,最后恢复


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "dandyhuang (via GitHub)" <gi...@apache.org>.
dandyhuang commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1519817599

   > connection_group
   
   这个是失败的时候,是将connection_group随便设置一个值吗


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "jialei-jialei (via GitHub)" <gi...@apache.org>.
jialei-jialei commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-2021843704

   > 这个问题最终解决了吗?遇到问题修改connection_group不是最终方案吧。
   
   没有解决,设置connection_group后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


Re: [I] brpc故障恢复bug (brpc)

Posted by "dandyhuang (via GitHub)" <gi...@apache.org>.
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-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


Re: [I] brpc故障恢复bug (brpc)

Posted by "trevor211 (via GitHub)" <gi...@apache.org>.
trevor211 commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1499812817

   > 这个问题对目前的业务影响很大,比较头疼。我想到的办法是: 1.放弃使用brpc,改用grpc,但是grpc没brpc好,c++的grpc太臃肿了 2.改源码,把Socket类改写掉,去掉那一堆复杂的原子计数,用最简单的方式实现 3.应用层规避,brpc持续出现这个错误码,进程就自杀(把channel delete掉,重连,不知道是否有效果)
   
   第3点,应用层规避,这点应该解决不了问题,我们这边是每次都重新创建一个新的channel,但还是出现了这样的问题。


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1499884991

   > > 这个问题对目前的业务影响很大,比较头疼。我想到的办法是: 1.放弃使用brpc,改用grpc,但是grpc没brpc好,c++的grpc太臃肿了 2.改源码,把Socket类改写掉,去掉那一堆复杂的原子计数,用最简单的方式实现 3.应用层规避,brpc持续出现这个错误码,进程就自杀(把channel delete掉,重连,不知道是否有效果)
   > 
   > 问下现在连接类型是什么?短链接、长连接or连接池
   
   是长链接


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1506190966

   > > > > > > 我升级到了brpc1.4版本,依然没有解决这个问题,不断注入网络故障:ifconfig down/up bond的一个口,又复现了
   > > > > > 
   > > > > > 
   > > > > > 请问你们网络故障注入的具体流程是怎样的,每次网络注入故障多久后恢复?
   > > > > 
   > > > > 
   > > > > 我们是bond4组网,ifconfig down/up bond的其中一个网口,注入故障10s内随机,一直循环10几个小时,最后恢复
   > > > 
   > > > 
   > > > 请问在你们的环境中,大概多久能够复现呢?
   > > 
   > > 
   > > 一般来说,这样的故障跑一个晚上,第二天早上看,brpc基本会出问题。最快的时候见过,1-2个小时就出了。 复现的时候还见过除了E112以外的错误,E1008,一直返回超时,抓包看,没有包发到server端,bvar看connection是残缺的,2天都没自动恢复,所以我猜也是处于假死状态
   > 
   > 请问你们的环境中,ifconfig up bond之后立即就进行下一轮的ifconfig down bond了吗?还是等待了一段时间呢?如果等待,等了多久呢?
   
   这样表达,应该比较准确了:
   while (1) {
     ifdown bond
     sleep (rand(1, 99))
     ifup bond
     sleep(rand(1, 9))
   }
   这个方式只是复现的概率比较高,别的network restart,随机搞,也复现过


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1485045065

   这个问题对目前的业务影响很大,比较头疼。我想到的办法是:
   1.放弃使用brpc,改用grpc,但是grpc没brpc好,c++的grpc太臃肿了
   2.改源码,把Socket类改写掉,去掉那一堆复杂的原子计数,用最简单的方式实现
   3.应用层规避,brpc持续出现这个错误码,进程就自杀(把channel delete掉,重连,不知道是否有效果)


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


Re: [I] brpc故障恢复bug (brpc)

Posted by "netjia-cpu (via GitHub)" <gi...@apache.org>.
netjia-cpu commented on issue #2146:
URL: https://github.com/apache/brpc/issues/2146#issuecomment-1485021340

   > 请问“网络重启故障”具体是指什么呢?是如何注入的?我们也遇到了这个问题,client一直返回E112,直到重启才恢复,持续时间最长的client大约是40分钟。
   
   就是执行 service network restart


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