if (this.expectedNumberOfRenewsPerMin > 0) {
// Since the client wants to cancel it, reduce the threshold
// (1
// for 30 seconds, 2 for a minute)
// 每分钟期望收到的心跳(续约)次数增加两次
this.expectedNumberOfRenewsPerMin = this.expectedNumberOfRenewsPerMin + 2;
// 每分钟期望最小心跳(续约 )次数 = 修改后的expectedNumberOfRenewsPerMin * 默认的0.85
this.numberOfRenewsPerMinThreshold =
(int) (this.expectedNumberOfRenewsPerMin * serverConfig.getRenewalPercentThreshold());
}
// EurekaServer自我保护机制
synchronized (lock) {
if (this.expectedNumberOfRenewsPerMin > 0) {
// Since the client wants to cancel it, reduce the threshold (1 for 30 seconds, 2 for a minute)
// 每分钟期望收到的心跳(续约)次数减少两次
this.expectedNumberOfRenewsPerMin = this.expectedNumberOfRenewsPerMin - 2;
// 每分钟期望最小心跳(续约 )次数 = 修改后的expectedNumberOfRenewsPerMin * 默认的0.85
this.numberOfRenewsPerMinThreshold =
(int) (this.expectedNumberOfRenewsPerMin * serverConfig.getRenewalPercentThreshold());
}
}
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/yuu1009/article/details/80909344
内容来源于网络,如有侵权,请联系作者删除!