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

Deadlock in AbstractFramedChannel on server shutdown

XMLWordPrintable

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

      When a task is rejected for execution on an I/O thread, AbstractFramedChannel will attempt to run it on the current thread, which may deadlock the application.

      Found one Java-level deadlock:
      =============================
      "undertow-worker task-46":
        waiting to lock monitor 0x00007f23a0008ce8 (object 0x00000006c8081db0, a io.undertow.protocols.http2.Http2Channel),
        which is held by "undertow-worker I/O-15"
      "undertow-worker I/O-15":
        waiting to lock monitor 0x00007f239c00b308 (object 0x00000006c8413960, a java.lang.Object),
        which is held by "undertow-worker task-46"
      
      Java stack information for the threads listed above:
      ===================================================
      "undertow-worker task-46":
      	at io.undertow.server.protocol.framed.AbstractFramedChannel.flushSenders(AbstractFramedChannel.java:578)
      	- waiting to lock <0x00000006c8081db0> (a io.undertow.protocols.http2.Http2Channel)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel$5.run(AbstractFramedChannel.java:727)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel.runInIoThread(AbstractFramedChannel.java:246)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel.flush(AbstractFramedChannel.java:724)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel.queueFrame(AbstractFramedChannel.java:715)
      	at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.queueFinalFrame(AbstractFramedStreamSinkChannel.java:257)
      	- locked <0x00000006c8413960> (a java.lang.Object)
      	at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.shutdownWrites(AbstractFramedStreamSinkChannel.java:240)
      	- locked <0x00000006c8413960> (a java.lang.Object)
      	at org.xnio.conduits.StreamSinkChannelWrappingConduit.terminateWrites(StreamSinkChannelWrappingConduit.java:75)
      	at org.xnio.conduits.ConduitStreamSinkChannel.shutdownWrites(ConduitStreamSinkChannel.java:178)
      	at io.undertow.channels.DetachableStreamSinkChannel.shutdownWrites(DetachableStreamSinkChannel.java:79)
      	at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:614)
      	at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:486)
      	at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:575)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:339)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      "undertow-worker I/O-15":
      	at io.undertow.server.protocol.framed.AbstractFramedStreamSinkChannel.close(AbstractFramedStreamSinkChannel.java:525)
      	- waiting to lock <0x00000006c8413960> (a java.lang.Object)
      	at org.xnio.IoUtils.safeClose(IoUtils.java:152)
      	at io.undertow.protocols.http2.Http2Channel.closeSubChannels(Http2Channel.java:645)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameCloseListener.handleEvent(AbstractFramedChannel.java:1068)
      	- locked <0x00000006c8081db0> (a io.undertow.protocols.http2.Http2Channel)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameCloseListener.handleEvent(AbstractFramedChannel.java:978)
      	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      	at io.undertow.protocols.ssl.SslConduit$SslReadReadyHandler.terminated(SslConduit.java:1202)
      	at org.xnio.nio.NioSocketConduit.readTerminated(NioSocketConduit.java:332)
      	at org.xnio.nio.NioSocketStreamConnection.notifyReadClosed(NioSocketStreamConnection.java:148)
      	at org.xnio.Connection.close(Connection.java:139)
      	at org.xnio.IoUtils.safeClose(IoUtils.java:152)
      	at io.undertow.protocols.ssl.SslConduit$SslReadReadyHandler.forceTermination(SslConduit.java:1196)
      	at org.xnio.nio.NioSocketConduit.forceTermination(NioSocketConduit.java:106)
      at org.xnio.nio.WorkerThread.run(WorkerThread.java:507)
      

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              carterkozak Carter Kozak
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: