KEYCLOAK-14302 Fix the setting of the lifespan for cache entries. This bug caused that jobs were no longer executed after temporary network partition in multinode setup, because the cluster based locks used for the coordination were never released.

This commit is contained in:
Achim Hügen 2020-09-13 10:56:32 +02:00 committed by Marek Posolda
parent eac3341241
commit 66dfa32cd5

View file

@ -150,9 +150,9 @@ public class InfinispanClusterProviderFactory implements ClusterProviderFactory
try { try {
V result; V result;
if (taskTimeoutInSeconds > 0) { if (taskTimeoutInSeconds > 0) {
result = (V) crossDCAwareCacheFactory.getCache().putIfAbsent(key, value);
} else {
result = (V) crossDCAwareCacheFactory.getCache().putIfAbsent(key, value, taskTimeoutInSeconds, TimeUnit.SECONDS); result = (V) crossDCAwareCacheFactory.getCache().putIfAbsent(key, value, taskTimeoutInSeconds, TimeUnit.SECONDS);
} else {
result = (V) crossDCAwareCacheFactory.getCache().putIfAbsent(key, value);
} }
resultRef.set(result); resultRef.set(result);