JBoss - Java heap retention in session cache DefaultDataContainer after session listener exceptions

Solution Unverified - Updated -

Issue

  • We see exceptions during session destruction from a session listener and after enough such exceptions an OutOfMemoryError is eventually reached with heap consumed by many org.infinispan.container.entries.ImmortalCacheEntrys in a org.infinispan.container.impl.DefaultDataContainer session cache
WARN  [org.wildfly.clustering.web.infinispan] (SessionExpirationScheduler - 1) WFLYCLWEBINF0004: Failed to expire session ypieHzHp1gCnVEibsm_ZiYShDaLggbRmYBpa65re: java.lang.RuntimeException: java.lang.NullPointerException
    at io.undertow.servlet//io.undertow.servlet.core.SessionListenerBridge.sessionDestroyed(SessionListenerBridge.java:75)
    at io.undertow.core@2.0.30.SP2-redhat-00001//io.undertow.server.session.SessionListeners.sessionDestroyed(SessionListeners.java:61)
    at org.wildfly.clustering.web.undertow@7.2.8.GA-redhat-00002//org.wildfly.clustering.web.undertow.session.UndertowSessionExpirationListener.sessionExpired(UndertowSessionExpirationListener.java:56)
    at org.wildfly.clustering.web.infinispan@7.2.8.GA-redhat-00002//org.wildfly.clustering.web.infinispan.session.ExpiredSessionRemover.remove(ExpiredSessionRemover.java:61)
    at org.wildfly.clustering.web.infinispan@7.2.8.GA-redhat-00002//org.wildfly.clustering.web.infinispan.session.ExpiredSessionRemover.remove(ExpiredSessionRemover.java:40)
    at org.wildfly.clustering.web.infinispan@7.2.8.GA-redhat-00002//org.wildfly.clustering.web.infinispan.session.SessionExpirationScheduler$ExpirationTask.run(SessionExpirationScheduler.java:149)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
    at org.jboss.threads@2.3.3.Final-redhat-00001//org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.NullPointerException
    at deployment.02721921.war//com.listeners.CustomHttpSessionListener.sessionDestroyed(CustomHttpSessionListener.java:28)
    at io.undertow.servlet//io.undertow.servlet.core.ApplicationListeners.sessionDestroyed(ApplicationListeners.java:328)
    at io.undertow.servlet//io.undertow.servlet.core.SessionListenerBridge.doDestroy(SessionListenerBridge.java:98)
    at io.undertow.servlet//io.undertow.servlet.core.SessionListenerBridge.access$000(SessionListenerBridge.java:41)
    at io.undertow.servlet//io.undertow.servlet.core.SessionListenerBridge$1.call(SessionListenerBridge.java:54)
    at io.undertow.servlet//io.undertow.servlet.core.SessionListenerBridge$1.call(SessionListenerBridge.java:51)
    at io.undertow.servlet//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow@7.2.8.GA-redhat-00002//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow@7.2.8.GA-redhat-00002//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
    at org.wildfly.extension.undertow@7.2.8.GA-redhat-00002//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
    at org.wildfly.extension.undertow@7.2.8.GA-redhat-00002//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
    at org.wildfly.extension.undertow@7.2.8.GA-redhat-00002//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
    at io.undertow.servlet//io.undertow.servlet.core.SessionListenerBridge.sessionDestroyed(SessionListenerBridge.java:73)
    ... 12 more

Environment

  • JBoss Enterprise Application Platform (EAP) 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content