diff --git a/docs/clustering.md b/docs/clustering.md
index 5dab3d8c2..e5bcf7c3b 100644
--- a/docs/clustering.md
+++ b/docs/clustering.md
@@ -32,13 +32,11 @@ serviceMatcher.isFromSelf(event)
### Caching
-Every node is maintaining its own caches independent from other nodes.
+Every node is maintaining its own caches independent of the other nodes.
So there is no globally shared/synchronized cache instance within the cluster.
In order to keep nodes in sync, a **TTL (time to live)** can be set for all caches to ensure that after some time the cache is refreshed from the database.
-To enable the TTL just set the property `hawkbit.cache.global.ttl` (value in milliseconds).
-
-Of course, you can implement a shared cache, e.g. Redis. See [CacheAutoConfiguration](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheAutoConfiguration.java).
+To enable the TTL just set the property `hawkbit.cache.global.ttl` (value in dDhHmMsS format).
---
diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/TenantAwareCacheManager.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/TenantAwareCacheManager.java
index 52e3fbe5b..2ef6ea81c 100644
--- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/TenantAwareCacheManager.java
+++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/TenantAwareCacheManager.java
@@ -19,6 +19,7 @@ import com.github.benmanes.caffeine.cache.Caffeine;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.NonNull;
+import lombok.extern.slf4j.Slf4j;
import org.eclipse.hawkbit.tenancy.TenantAware.TenantResolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
@@ -34,6 +35,7 @@ import org.springframework.lang.Nullable;
*
If no tenant is resolved, a global cache manager is used.
*
*/
+@Slf4j
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@SuppressWarnings("java:S6548") // singleton holder ensures static access to spring resources in some places
public class TenantAwareCacheManager implements CacheManager {
@@ -115,7 +117,12 @@ public class TenantAwareCacheManager implements CacheManager {
spec = defaultSpec;
}
}
- return new CaffeineCache(n, Caffeine.from(spec).build(), false);
+ try {
+ return new CaffeineCache(n, Caffeine.from(spec).build(), false);
+ } catch (final IllegalArgumentException e) {
+ log.error("Invalid cache spec: {}", spec, e);
+ throw new IllegalStateException("Invalid cache spec: " + spec, e);
+ }
});
}
diff --git a/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties b/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties
index dac11c1e6..b53cfc9d7 100644
--- a/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties
+++ b/hawkbit-monolith/hawkbit-update-server/src/main/resources/application.properties
@@ -39,7 +39,7 @@ hawkbit.server.ddi.security.authentication.gatewaytoken.enabled=false
# Cache configuration,
# disable expiration since monolith is expected to be used as an all-in-one hawkBit instance,
# i.e. no microservices and 1 replica, then evict should do work
-hawkbit.cache.ttl=0
+hawkbit.cache.ttl=0s
# Optional events
hawkbit.server.repository.publish-target-poll-event=false
diff --git a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java
index 13e98f403..ca2f90bd1 100644
--- a/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java
+++ b/hawkbit-rest-core/src/main/java/org/eclipse/hawkbit/rest/RestConfiguration.java
@@ -181,7 +181,7 @@ public class RestConfiguration {
* @param ex the exception which occurred
* @return the entity to be responded containing the response status 500
*/
- @ExceptionHandler(FileStreamingFailedException.class)
+ @ExceptionHandler({ FileStreamingFailedException.class, IllegalStateException.class })
public ResponseEntity