spring-cloud / spring-cloud/spring-cloud-zookeeper
Invalidate cache entry for service instances by subscribing to curator TreeCache
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 574
- Forks
- 408
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 4
Description
Current ZookeeperLoadBalancerConfiguration implementation caches service instances for 35 seconds by default.
If any instance get down in this period we will load balance on it anyway.
Of course, we can disable service instance cache, but it is not good by performance reasons (and zookeeper possible downtime).
In our project we implemented ServiceInstanceListCacheInvalidator which is subscribed to TreeCache from ZookeeperServiceWatch.
It removes single service instances (one cache entry) from cache when it is notified about that service instances change.
With this feature we can safely increase cache ttl to a relative big value (15 minutes or more).
What do you think about it? Can i make pull request with this feature?
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 by reading ZookeeperLoadBalancerConfiguration and ZookeeperServiceWatch, then examine how service instance caching and TreeCache notifications currently interact. Assess the proposed ServiceInstanceListCacheInvalidator behavior; done should mean changed service instances invalidate only their corresponding cache entries, with coverage for the notification and invalidation flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100