spring-cloud-openfeign
spring-cloud-openfeign copied to clipboard
fix: prevent duplicate cache error handler execution in FeignCachingInvocationHandlerFactory
This PR fixes an issue where cache error handling is executed twice when using @Cacheable on Feign clients.
Problem
Caching was being applied twice:
- Once by Spring Cache (CacheInterceptor)
- Once by FeignCachingInvocationHandlerFactory
This caused duplicate execution of cache error handling methods.
Solution
Added a ThreadLocal guard to prevent nested cache invocation inside FeignCachingInvocationHandlerFactory.
Result
- Cache interception is executed only once
- Prevents duplicate error handler execution
Closes #681