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 2020/05/20 07:02:45 UTC
[GitHub] [incubator-brpc] dengbq1234 opened a new issue #1118: 健康检查
dengbq1234 opened a new issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118
在brpc的客户端,如果每隔一段时间才调用,如每隔5分钟,有什么办法知道连接有异常了,客户端channal里面没有找到相应的通知接口。
难道只能由应用周期去检查,框架没有提供相应的能力?
----------------------------------------------------------------
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.
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] gydong edited a comment on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
gydong edited a comment on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-760599407
> 请教一下,遇到个情况,网卡挡down后,发消息还正常但超时,这种情况brpc是没有心跳检测吗?

这两个timeout,你分别设置成了多少?如果timeout_ms比connect_timeout_ms短的话,可能会出现你遇到的问题
----------------------------------------------------------------
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.
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] guowei-bian commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
guowei-bian commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-759892215
请教一下,遇到个情况,网卡挡down后,发消息还正常但超时,这种情况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.
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] zyearn commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
zyearn commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-634412546
既然不想调用某接口,为什么还要知道当前连接是否有异常呢
----------------------------------------------------------------
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.
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] dengbq1234 commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
dengbq1234 commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-634374845
自动重试和Failed,这两种情况我知道,但前提是得有业务去主动调用rpc接口才能知道failed了,如果业务不想每隔几秒去调用某个接口,但又想知道当前的连接是否有异常,当前好像是没有办法的。
----------------------------------------------------------------
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.
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] zyearn commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
zyearn commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-632451719
如果连接异常的话,会自动重试的;如果是因为异常导致rpc失败,会体现在controller.Failed(),以及controller.ErrorText()中
----------------------------------------------------------------
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.
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] dengbq1234 commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
dengbq1234 commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-636671156
试了一下,继承channel,重载CheckHealth,不起作用。
直接在channel.cpp的checkHealth()里面加打印日志,结果加的打印日志根本没有执行,而加在其它的地方的打印日志有执行。
使用的example/echo++这个例子修改的。
难道CheckHealth函数是做其它用途的?
----------------------------------------------------------------
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.
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] jamesge commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
jamesge commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-636794417
这个checkhealth只在SelectiveChannel中有用,其他情况下连接断开时不会去调用的。RPC层面不太会暴露“连接是否在“这种信息的,因为RPC和TCP没有必然联系,完全可以基于不需要连接的传输协议。从这点来说,你的需求也显得有些奇怪,你可以描述地更具体一些,看看是不是其实并不需要“定期去检查连接是否在”
----------------------------------------------------------------
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.
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] zyearn commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
zyearn commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-635071949
如果一定要这么做的话,可以实现一个Channel继承brpc::Channel,然后实现CheckHealth接口,具体实现是调用brpc::Channel::CheckHealth(),继承和接口关系看一下Channel和ChannelBase的定义。然后调用chan.CheckHealth()能达到你要的效果
----------------------------------------------------------------
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.
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] guowei-bian commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
guowei-bian commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-760666248
> 这两个timeout,你分别设置成了多少?如果timeout_ms比connect_timeout_ms短的话,可能会出现你遇到的问题
超时时间60s,连接超时为缺省值。验证很多次,发现网卡down掉后,消息还能发送但60s后报超时。如果能提前探测到连接断了,让消息返错就好了。
----------------------------------------------------------------
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.
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] dengbq1234 closed issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
dengbq1234 closed issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118
----------------------------------------------------------------
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.
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] dengbq1234 commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
dengbq1234 commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-635861391
ok,多谢,我试一下。
----------------------------------------------------------------
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.
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] dengbq1234 commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
dengbq1234 commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-635032520
我们想在客户端与服务端连接异常(如网络断连)时,做一些处理。如果只有调用接口这一种方法,那业务得专门增加一个检测线程,这与 brpc的 health check 线程的作用重复了。
----------------------------------------------------------------
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.
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] dengbq1234 commented on issue #1118: 健康检查
Posted by GitBox <gi...@apache.org>.
dengbq1234 commented on issue #1118:
URL: https://github.com/apache/incubator-brpc/issues/1118#issuecomment-637200663
我的需求就是之前描述 的,在网络异常或者服务端异常退出时,客户端做一些相应的处理。我查了下,grpc也没有提供这样的接口。看来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.
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