diff --git a/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java b/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java index 6e79a2a4636..b2e898d05ad 100644 --- a/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java +++ b/jetty-infinispan/src/main/java/org/eclipse/jetty/session/infinispan/InfinispanSessionManager.java @@ -654,14 +654,11 @@ public class InfinispanSessionManager extends AbstractSessionManager long now = System.currentTimeMillis(); LOG.info("SessionManager for context {} scavenging at {} ", getContextPath(getContext()), now); - synchronized (_sessions) + for (Map.Entry entry:_sessions.entrySet()) { - for (Map.Entry entry:_sessions.entrySet()) - { - long expiry = entry.getValue().getExpiry(); - if (expiry > 0 && expiry < now) - candidateIds.add(entry.getKey()); - } + long expiry = entry.getValue().getExpiry(); + if (expiry > 0 && expiry < now) + candidateIds.add(entry.getKey()); } for (String candidateId:candidateIds)