spring-cloud / spring-cloud/spring-cloud-commons

Spring Cloud LoadBalancer default cache warning should take discovery client implementation into account

Open
#1,540 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
751
Forks
744
Avg merge
1d 14h
Merged PRs (30d)
9

Description

When using the default cache, the following warning is logged:

Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it to the classpath.

As clarified in the docs via https://github.com/spring-cloud/spring-cloud-commons/pull/991, this is unnecessary if using a Service Discovery implementation which itself performs caching, such as EurekaDiscoveryClient.

IMO this is something that the framework can/should take into account. Supressing the warning if a known DiscoveryClient implementation is on the classpath (e.g. via @ConditionalOnClass or even a simple Class lookup).

A user seeing this warning will add e.g. Caffeine as a cache mechanism while potentially then introducing a buggy double-caching layer, unless they carefully read a specific section of the docs and/or are using a caching mechanism that does not contain caching itself (e.g. EurekaDiscoveryClient).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name a file or test; start by locating the Spring Cloud LoadBalancer code that emits the default-cache warning and reviewing the documented EurekaDiscoveryClient behavior in PR #991. Done means the warning accounts for a known discovery client that already caches, without prompting an unnecessary second cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.