Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-17348

A distributed web application request coinciding with leaving of the primary session owner can cause an NPE

XMLWordPrintable

      • start a 4 nodes cluster configured as in description
      • deploy [^clusterbench-jakarta10.ear]
      • shutdown/restart nodes each node in sequence
    • ---
    • ---

      We have a 4 nodes EAP cluster running with profile "standalone-ha.xml";

      Each node is configured with scattered cache:

      embed-server --server-config=standalone-ha.xml
      if (outcome != success) of /subsystem=jgroups:read-attribute(name=default-stack)
      /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcp)
      else
      /subsystem=jgroups:write-attribute(name=default-stack,value=tcp)
      /subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcp)
      end-if
      /subsystem=infinispan/cache-container=web/scattered-cache=testScattered:add()
      /subsystem=infinispan/cache-container=web:write-attribute(name=default-cache, value=testScattered)
      

      At some point, apparently when a new node joined the cluster, on another node we have the following error:

      2022-11-30 10:03:11,367 INFO  [org.infinispan.CLUSTER] (thread-35,ejb,wildfly4) ISPN100000: Node wildfly1 joined the cluster
      2022-11-30 10:04:57,116 ERROR [io.undertow.servlet.request] (default task-42) UT015005: Error invoking method requestInitialized on listener class org.jboss.weld.module.web.servlet.WeldInitialListener: java.lang.NullPointerException
      	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1690)
      	at org.wildfly.clustering.server.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.server.infinispan.dispatcher.ChannelCommandDispatcherFactory.createNode(ChannelCommandDispatcherFactory.java:271)
      	at org.wildfly.clustering.server.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.server.infinispan.dispatcher.ChannelCommandDispatcherFactory.createNode(ChannelCommandDispatcherFactory.java:83)
      	at org.wildfly.clustering.server.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.server.infinispan.group.CacheGroup.createNode(CacheGroup.java:129)
      	at org.wildfly.clustering.server.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.server.infinispan.group.CacheGroup.createNode(CacheGroup.java:65)
      	at org.wildfly.clustering.ee.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.ee.infinispan.PrimaryOwnerLocator.apply(PrimaryOwnerLocator.java:54)
      	at org.wildfly.clustering.ee.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.ee.infinispan.PrimaryOwnerLocator.apply(PrimaryOwnerLocator.java:38)
      	at org.wildfly.clustering.web.infinispan@8.0.0.Beta-redhat-00003//org.wildfly.clustering.web.infinispan.routing.PrimaryOwnerRouteLocator.locate(PrimaryOwnerRouteLocator.java:55)
      	at org.wildfly.clustering.web.undertow@8.0.0.Beta-redhat-00003//org.wildfly.clustering.web.undertow.routing.DistributableSessionIdentifierCodec.encode(DistributableSessionIdentifierCodec.java:45)
      	at org.wildfly.extension.undertow@8.0.0.Beta-redhat-00003//org.wildfly.extension.undertow.session.CodecSessionConfig.findSessionId(CodecSessionConfig.java:63)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.spec.ServletContextImpl$ServletContextSessionConfig.findSessionId(ServletContextImpl.java:1255)
      	at org.wildfly.clustering.web.undertow@8.0.0.Beta-redhat-00003//org.wildfly.clustering.web.undertow.session.DistributableSessionManager.getSession(DistributableSessionManager.java:220)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.spec.ServletContextImpl.getSession(ServletContextImpl.java:878)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.spec.HttpServletRequestImpl.getSession(HttpServletRequestImpl.java:443)
      	at org.jboss.weld.core@5.0.1.Final-redhat-00001//org.jboss.weld.module.web.servlet.SessionHolder.requestInitialized(SessionHolder.java:47)
      	at org.jboss.weld.core@5.0.1.Final-redhat-00001//org.jboss.weld.module.web.servlet.HttpContextLifecycle.requestInitialized(HttpContextLifecycle.java:260)
      	at org.jboss.weld.core@5.0.1.Final-redhat-00001//org.jboss.weld.module.web.servlet.WeldInitialListener.requestInitialized(WeldInitialListener.java:146)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.core.ApplicationListeners.requestInitialized(ApplicationListeners.java:263)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:274)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      	at org.wildfly.extension.undertow@8.0.0.Beta-redhat-00003//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1431)
      	at org.wildfly.extension.undertow@8.0.0.Beta-redhat-00003//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1431)
      	at org.wildfly.extension.undertow@8.0.0.Beta-redhat-00003//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1431)
      	at org.wildfly.extension.undertow@8.0.0.Beta-redhat-00003//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1431)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
      	at io.undertow.servlet@2.3.0.Alpha2-redhat-00001//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)
      	at io.undertow.core@2.3.0.Alpha2-redhat-00001//io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
      	at io.undertow.core@2.3.0.Alpha2-redhat-00001//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads@2.4.0.Final-redhat-00001//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at org.jboss.xnio@3.8.7.Final-redhat-00001//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

      The error affects the clients but with a very low fail rate (below 0.1%), that's why the issue isn't marked as blocker;

              pferraro@redhat.com Paul Ferraro
              pferraro@redhat.com Paul Ferraro
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: