You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We depend on Caffeine to cache some stuff. The cache is configured with a lockTimeout of 5 secs. However, it doesn't seem like the cache properly locks out concurrent attempts to access the cache (when the cached key is missing) as putting log statements in the cache method indicates it being invoked multiple times.
This causes issues further into the processing of incoming requests in our production and QA environment.
I've been able to reproduce this issue in versions 2.16.5.Final, 2.16.6.Final and 2.16.7.Final.
But I'm not sure to what lengths one should go to fix this as this issue seems to be gone in 3.1.1.Final.
Expected behavior
Only one invocation of the cached method whenever the cache key is missing
Actual behavior
If the cache key is missing, multiple invocations seem to occur in the cache method
Thanks for highlighting this. I'll follow in his tracks and resolve this one. We'll most likely migrate to Quarkus 3 during the summer and can live with the issues for the time being.
Describe the bug
We depend on Caffeine to cache some stuff. The cache is configured with a lockTimeout of 5 secs. However, it doesn't seem like the cache properly locks out concurrent attempts to access the cache (when the cached key is missing) as putting log statements in the cache method indicates it being invoked multiple times.
This causes issues further into the processing of incoming requests in our production and QA environment.
I've been able to reproduce this issue in versions 2.16.5.Final, 2.16.6.Final and 2.16.7.Final.
But I'm not sure to what lengths one should go to fix this as this issue seems to be gone in 3.1.1.Final.
Expected behavior
Only one invocation of the cached method whenever the cache key is missing
Actual behavior
If the cache key is missing, multiple invocations seem to occur in the cache method
How to Reproduce?
Reproducer can be found here: https://github.com/technical-debt-collector/quarkus-cache-repro
The project contains a scheduled method that calls a simple API which in turn will access the cache.
The issue goes away when running with Quarkus 3.1.1.Final.
One can also query the metrics and observe that the cache puts increase faster than expected
Output of
uname -a
orver
Linux fedora 6.2.12-200.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 20 23:38:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "19.0.2" 2023-01-17 OpenJDK Runtime Environment Homebrew (build 19.0.2) OpenJDK 64-Bit Server VM Homebrew (build 19.0.2, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.7
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven home: /home/olasaeterheitmann/.m2/wrapper/dists/apache-maven-3.8.8-bin/67c30f74/apache-maven-3.8.8 Java version: 17.0.6, vendor: Eclipse Adoptium, runtime: /home/olasaeterheitmann/.sdkman/candidates/java/17.0.6-tem Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "6.2.12-200.fc37.x86_64", arch: "amd64", family: "unix"
Additional information
No response
The text was updated successfully, but these errors were encountered: