Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1304

Wildfly shutdown deadlock with active websocket session

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.2.Final, 1.4.24.Final
    • None
    • None
    • None
    • Hide

      Deploy an application with @ServerEndpoint() websocket endpoint. Connect to that websocket. Shutdown wildfly.

      Show
      Deploy an application with @ServerEndpoint() websocket endpoint. Connect to that websocket. Shutdown wildfly.

      Wildfly hangs during shutdown if a websocket session is active. @OnClose callback is called, but after that, wildfly hangs forever. Thread dump shows that two threads are in BLOCKED state:

      "default task-7" #429 prio=5 os_prio=0 tid=0x00005609dcd78800 nid=0x4bf6 waiting for monitor entry [0x00007fadc61bd000]
         java.lang.Thread.State: BLOCKED (on object monitor)
              at io.undertow.websockets.jsr.ServerWebSocketContainer$10.run(ServerWebSocketContainer.java:892)
              - waiting to lock <0x00000000f5fad4e0> (a io.undertow.websockets.jsr.ServerWebSocketContainer)
              - locked <0x00000000f0f7edf8> (a io.undertow.websockets.jsr.ServerWebSocketContainer$10)
              at io.undertow.websockets.jsr.SessionContainer.removeOpenSession(SessionContainer.java:52)
              - locked <0x00000000f5fad5a0> (a io.undertow.websockets.jsr.ConfiguredServerEndpoint)
              at io.undertow.websockets.jsr.UndertowSession$2.run(UndertowSession.java:370)
              at io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
              at java.lang.Thread.run(Thread.java:748)
      
         Locked ownable synchronizers:
              - None          
      
      "ServerService Thread Pool -- 50" #82 prio=5 os_prio=0 tid=0x00005609d81f1000 nid=0x48e8 waiting for monitor entry [0x00007fade862d000]
         java.lang.Thread.State: BLOCKED (on object monitor)
              at java.lang.Object.wait(Native Method)
              at io.undertow.websockets.jsr.SessionContainer.awaitClose(SessionContainer.java:67)
              - locked <0x00000000f5fad5a0> (a io.undertow.websockets.jsr.ConfiguredServerEndpoint)
              at io.undertow.websockets.jsr.ServerWebSocketContainer.close(ServerWebSocketContainer.java:779)
              - locked <0x00000000f5fad4e0> (a io.undertow.websockets.jsr.ServerWebSocketContainer)
              at io.undertow.websockets.jsr.ServerWebSocketContainer.close(ServerWebSocketContainer.java:784)
              - locked <0x00000000f5fad4e0> (a io.undertow.websockets.jsr.ServerWebSocketContainer)
              at io.undertow.websockets.jsr.Bootstrap$WebSocketListener.contextDestroyed(Bootstrap.java:128)
              at io.undertow.servlet.core.ApplicationListeners.contextDestroyed(ApplicationListeners.java:202)
              at io.undertow.servlet.core.DeploymentImpl.destroy(DeploymentImpl.java:252)
              at io.undertow.servlet.core.DeploymentManagerImpl$4.call(DeploymentManagerImpl.java:663)
              at io.undertow.servlet.core.DeploymentManagerImpl$4.call(DeploymentManagerImpl.java:660)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
              at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction$$Lambda$1145/655479276.call(Unknown Source)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$1146/915737155.call(Unknown Source)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$1146/915737155.call(Unknown Source)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$1146/915737155.call(Unknown Source)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$1146/915737155.call(Unknown Source)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$1146/915737155.call(Unknown Source)
              at io.undertow.servlet.core.DeploymentManagerImpl.undeploy(DeploymentManagerImpl.java:668)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.stopContext(UndertowDeploymentService.java:139)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$2.run(UndertowDeploymentService.java:117)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
              at java.lang.Thread.run(Thread.java:748)
              at org.jboss.threads.JBossThread.run(JBossThread.java:485)
      
         Locked ownable synchronizers:
              - None   
      

      There may be some other necessary conditions necessary to reproduce the issue (specific wildfly configuration, some application setup). If the issue is not clear from the thread dump, I can create some small example reproducing the problem.

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              sebek64 Marcel Ĺ ebek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: