ConcurrentModificationException is thrown in DistributableSessionManager.getSession
Issue
When clustering is enabled, the following exception is rarely logged in server.log. What is the cause and how to deal with it?
JBoss EAP 7.2.0 - 7.2.9:
12:18:28,197 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /testapp/session: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469)
at java.util.HashMap$KeyIterator.next(HashMap.java:1493)
at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findListeners(InfinispanSessionManager.java:346)
at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.triggerPostActivationEvents(InfinispanSessionManager.java:334)
at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findSession(InfinispanSessionManager.java:226)
at org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:211)
at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:858)
at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:933)
...
JBoss EAP 7.3.0 - 7.3.6:
10:44:44,991 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /testapp/session: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1469)
at java.util.HashMap$KeyIterator.next(HashMap.java:1493)
at org.wildfly.clustering.web.cache.session.ImmutableFilteringHttpSession.getAttributes(ImmutableFilteringHttpSession.java:57)
at org.wildfly.clustering.web.cache.session.ImmutableSessionActivationNotifier.notify(ImmutableSessionActivationNotifier.java:63)
at org.wildfly.clustering.web.cache.session.ImmutableSessionActivationNotifier.postActivate(ImmutableSessionActivationNotifier.java:58)
at org.wildfly.clustering.web.cache.session.coarse.CoarseSessionAttributes.<init>(CoarseSessionAttributes.java:57)
at org.wildfly.clustering.web.infinispan.session.coarse.CoarseSessionAttributesFactory.createSessionAttributes(CoarseSessionAttributesFactory.java:131)
at org.wildfly.clustering.web.infinispan.session.coarse.CoarseSessionAttributesFactory.createSessionAttributes(CoarseSessionAttributesFactory.java:62)
at org.wildfly.clustering.web.cache.session.CompositeSessionFactory.createSession(CompositeSessionFactory.java:118)
at org.wildfly.clustering.web.infinispan.session.InfinispanSessionManager.findSession(InfinispanSessionManager.java:181)
at org.wildfly.clustering.web.cache.session.ConcurrentSessionManager$2.apply(ConcurrentSessionManager.java:66)
at org.wildfly.clustering.web.cache.session.ConcurrentSessionManager$2.apply(ConcurrentSessionManager.java:63)
at org.wildfly.clustering.ee.cache.SimpleManager.apply(SimpleManager.java:52)
at org.wildfly.clustering.web.cache.session.ConcurrentSessionManager.findSession(ConcurrentSessionManager.java:70)
at org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:227)
at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:874)
at io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:964)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:69)
...
In addition, cache container settings remain the default in standalone-full-ha.xml:
<cache-container name="web" default-cache="dist" module="org.wildfly.clustering.web.infinispan">
<transport lock-timeout="60000"/>
<distributed-cache name="dist">
<locking isolation="REPEATABLE_READ"/>
<transaction mode="BATCH"/>
<file-store/>
</distributed-cache>
</cache-container>
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.2
- 7.3.0 to 7.3.6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.