spring-cloud / spring-cloud/spring-cloud-openfeign

Cache get error handler execute twice

Open
#681 2 comments 0 reactions 1 assignee View on GitHub

@OlgaMaciaszek is already working on this.

Since Feb 25, 2022.

bug
Dominant language
Java
Stars
1.3k
Forks
838
Avg merge
2d 11h
Merged PRs (30d)
13

Description

Describe the bug
During getting elements from cache, annotated by @Cacheable on FeignClient, cache get error handler execute twice.
It looks like it is caused by change https://github.com/spring-cloud/spring-cloud-openfeign/pull/608. The flow seems to be as follows:

-> CacheInterceptor
   -> CacheAspectSupport#execute:402 (findCachedItem)
      -> handleCacheGetError 
   -> CacheAspectSupport#execute:421 (invokeOperation)
      -> FeignCachingInvocationHandlerFactory#create:53 (cacheInterceptor.invoke)
         -> CacheAspectSupport#execute:402 (findCachedItem) 
            -> handleCacheGetError

Affected spring cloud version: 2021.0.0

Sample
Sample application that reproduces the problem: https://github.com/fureq/spring-feign-bug. Details are described in readme.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.