spring-cloud / spring-cloud/spring-cloud-netflix
lease expiration on standalone Eureka server with self-presenvation enabled is broken
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 5k
- Forks
- 2.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 10
Description
It looks like lease expiration on standalone Eureka server with self-presenvation enabled is completely broken. I have the following configuration:
eureka.instance.hostname=localhost
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
eureka.server.renewalThresholdUpdateIntervalMs=60000
# this should be the same as eureka.instance.lease-renewal-interval-in-seconds on the clients
eureka.server.expected-client-renewal-interval-seconds=10
If I start completely empty server with this configuration it says:
c.n.e.r.PeerAwareInstanceRegistryImpl : Got 1 instances from neighboring DS node
c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 5
I tracked it down to defaultOpenForTrafficCount which by default is set to 1, changed to
eureka.instance.registry.defaultOpenForTrafficCount=0 . Now the server starts with:
c.n.e.r.PeerAwareInstanceRegistryImpl : Got 0 instances from neighboring DS node
c.n.e.r.PeerAwareInstanceRegistryImpl : Renew threshold is: 0
Issue however not solved because even if I add dozen of eureka clients the threshold never changes even when is actually recalculated. I get c.n.e.r.PeerAwareInstanceRegistryImpl : Current renewal threshold is : 0 in the logs every minute.
Hence, lease expiration never kicks in unless I completely disable self-preservation mode.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with PeerAwareInstanceRegistryImpl and the defaultOpenForTrafficCount and expected-client-renewal-interval-seconds settings described in the issue. Trace the renewal-threshold recalculation while running a standalone server with self-preservation enabled and added Eureka clients. Done means the threshold updates from zero and lease expiration works without disabling self-preservation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100