dangdangdotcom / dubbox

Dubbox now means Dubbo eXtensions, and it adds features like RESTful remoting, Kyro/FST serialization, etc to the Dubbo service framework.
http://dangdangdotcom.github.io/dubbox
Apache License 2.0
4.89k stars 2.06k forks source link

服务提供方的HeartBeatTask在遇到参数回调暴露的service时的心跳问题 #311

Open zhiying8710 opened 7 years ago

zhiying8710 commented 7 years ago

在HeartBeatTask的run方法中, 如果channel是服务提供方参数回调的service的channel, 这时服务提供方属于client端, 把服务消费方异常停机, 当满足lastRead != null && now - lastRead > heartbeatTimeout时, channel不会被close, 会尝试重连, 如果服务消费方没有重启, 重连失败 到了下次再执行run方法的时候, 满足( lastRead != null && now - lastRead > heartbeat ) || ( lastWrite != null && now - lastWrite > heartbeat )这个条件, 会去发送心跳, 这就会抛异常, 即使现在刚刚异常停机的消费方重启了, 也无法进行重连.