Multiple cache invalidation not working with a native build
See original GitHub issueDescribe the bug
Hello, I have a REST endpoint to invalidate all my caches like so:
@DELETE
@CacheInvalidateAll(cacheName = Caches.MY_CACHE_A)
@CacheInvalidateAll(cacheName = Caches.MY_CACHE_B)
@CacheInvalidateAll(cacheName = Caches.MY_CACHE_C)
public void invalidateCaches() {
logger.info("Invalidating declared caches");
}
When running in dev mode, everything is fine. The DEBUG logs shows that all caches are properly invalidated :
2021-11-03 15:06:12,757 DEBUG [io.qua.cac.run.CacheInvalidateAllInterceptor] (executor-thread-0) Invalidating all entries from cache ["cacheA"]
2021-11-03 15:06:12,759 DEBUG [io.qua.cac.run.CacheInvalidateAllInterceptor] (executor-thread-0) Invalidating all entries from cache ["cacheB"]
2021-11-03 15:06:12,759 DEBUG [io.qua.cac.run.CacheInvalidateAllInterceptor] (executor-thread-0) Invalidating all entries from cache ["cacheC"]
When running in native mode, a bug investigation revealed that only one cache is invalidated. This was reproduced on locahost. Calls to other resources use data from the cache instead of calling the backends.
2021-11-03 15:06:12,759 DEBUG [io.qua.cac.run.CacheInvalidateAllInterceptor] (executor-thread-0) Invalidating all entries from cache ["cacheB"]
(i have changed the cache names above but even after changing the order of the 3 annotations, it was always the same cache that was invalidated)
A temporary workaround is to have my multi-annotated method to delegate the invalidation to as many sub methods as necessary, each one with its own invalidation. Obviously that is the opposite of the interest to have multiple annotations.
(And as a side note, i know this is somewhere on the roadmap: being able to programmatically invalidate all caches from my enum instead of adding/forgetting to add an annotation would even be better)
Thanks for your help ! Pascal.
Expected behavior
All caches mentionned in each annotation are flushed.
Actual behavior
No response
How to Reproduce?
No response
Output of uname -a
or ver
Linux Sunnyvale 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version “11.0.12” 2021-07-20
GraalVM version (if different from Java)
OpenJDK Runtime Environment GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08)
Quarkus version or git rev
2.1.4.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Gradle 6.8.3
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (11 by maintainers)
It’s a Quarkus/ArC regression - we somehow overlooked the fact that
java.util.Set.of(E...)
throws an IAE if there are duplicate elements. I’ll prepare a fix.Not yet, I’ll create one.