Fix putAll issues

Closes: #16287
This commit is contained in:
Hynek Mlnarik 2023-01-05 17:35:32 +01:00 committed by Michal Hajas
parent cc641cb72b
commit 7708e2cc5c

View file

@ -865,7 +865,9 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
offline ? SessionTimeouts::getOfflineSessionLifespanMs : SessionTimeouts::getUserSessionLifespanMs, offline ? SessionTimeouts::getOfflineSessionLifespanMs : SessionTimeouts::getUserSessionLifespanMs,
offline ? SessionTimeouts::getOfflineSessionMaxIdleMs : SessionTimeouts::getUserSessionMaxIdleMs); offline ? SessionTimeouts::getOfflineSessionMaxIdleMs : SessionTimeouts::getUserSessionMaxIdleMs);
} else { } else {
cache.putAll(sessionsById); Retry.executeWithBackoff((int iteration) -> {
cache.putAll(sessionsById);
}, 10, 10);
} }
// put all entities to the remoteCache (if exists) // put all entities to the remoteCache (if exists)
@ -899,15 +901,17 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
} }
// Import client sessions // Import client sessions
Cache<UUID, SessionEntityWrapper<AuthenticatedClientSessionEntity>> clientSessCache = offline ? offlineClientSessionCache : clientSessionCache; Cache<UUID, SessionEntityWrapper<AuthenticatedClientSessionEntity>> clientSessCache =
clientSessCache = CacheDecorators.skipCacheLoaders(clientSessCache); CacheDecorators.skipCacheLoaders(offline ? offlineClientSessionCache : clientSessionCache);
if (importWithExpiration) { if (importWithExpiration) {
importSessionsWithExpiration(clientSessionsById, clientSessCache, importSessionsWithExpiration(clientSessionsById, clientSessCache,
offline ? SessionTimeouts::getOfflineClientSessionLifespanMs : SessionTimeouts::getClientSessionLifespanMs, offline ? SessionTimeouts::getOfflineClientSessionLifespanMs : SessionTimeouts::getClientSessionLifespanMs,
offline ? SessionTimeouts::getOfflineClientSessionMaxIdleMs : SessionTimeouts::getClientSessionMaxIdleMs); offline ? SessionTimeouts::getOfflineClientSessionMaxIdleMs : SessionTimeouts::getClientSessionMaxIdleMs);
} else { } else {
clientSessCache.putAll(clientSessionsById); Retry.executeWithBackoff((int iteration) -> {
clientSessCache.putAll(clientSessionsById);
}, 10, 10);
} }
// put all entities to the remoteCache (if exists) // put all entities to the remoteCache (if exists)