-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add possibility to configure expected interval between clients' renew… #1093
Conversation
…s and not break self-preservation
@mgtriffid Thanks your PR : ) |
I think there might be a more aggressive solution to make heartbeats interval configurable. Because there are too many hard code by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgtriffid the PR mostly looks good, thanks. I think you may need to make a change here too:
https://github.com/Netflix/eureka/blob/master/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L294
Also, please address @holy12345 's comment and add some safeguards to the config. Thanks.
this.numberOfRenewsPerMinThreshold = | ||
(int) (this.expectedNumberOfRenewsPerMin * serverConfig.getRenewalPercentThreshold()); | ||
(int) (this.expectedNumberOfClientsSendingRenews |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This computation is repeated three times and might be better moved to a central method.
Sorry, I don't get it what do these two minutes mean. This seems to be an expiration check, but it uses lease duration and last lease renewal, and I can't understand why do we need to add 2 minutes. Could you kindly explain, @qiangdavidliu ? Addressed other comments. |
@mgtriffid no worries, that was a minor issue. Thank you for the PR. |
…s and not break self-preservation
Currently, if one sets renewal interval different from 30 seconds on clients, self-preservation doesn't work correctly. For example, see spring-cloud/spring-cloud-netflix#373 . This PR adds possibility to configure expected renewal interval on Eureka server, so that if clients send renews every, say, 20 seconds, then SP threshold is
0.85 * 3 * count
, not0.85 * 2 * count
.