Uploaded image for project: 'XNIO'
  1. XNIO
  2. XNIO-265

Accept thread blocks forever on java.nio.channels.SelectableChannel.register

XMLWordPrintable

    • Hide

      unknown

      Show
      unknown

      I'm running into this issue in a small spring boot / undertow service that handles websocket and plain old HTTP POST requests.

      After running fine for about a week it eventually got the XNIO accept thread blocked on AbstractSelectableChannel.register (stack trace for the stuck thread below) and has remained stuck since.

      I got what I believe was the same issue a couple weeks ago (but have no stack traces from that time), so this time around the application is running with the YourKit agent active, and I have a memory snapshot in the stuck state (the thread has been blocked for 24h+ at this point).

      "XNIO-2 Accept" #28 prio=5 os_prio=0 tid=0x00007fd2737de000 nid=0x7e0f waiting for monitor entry [0x00007fd262999000]
      java.lang.Thread.State: BLOCKED (on object monitor)
      at sun.nio.ch.SelectorImpl.register(SelectorImpl.java:131)

      • waiting to lock <0x00000005cd8325d8> (a java.util.Collections$UnmodifiableSet)
        at java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:212)
      • locked <0x000000066e197560> (a java.lang.Object)
      • locked <0x000000066e197550> (a java.lang.Object)
        at java.nio.channels.SelectableChannel.register(SelectableChannel.java:280)
        at org.xnio.nio.WorkerThread.registerChannel(WorkerThread.java:696)
        at org.xnio.nio.QueuedNioTcpServer.handleReady(QueuedNioTcpServer.java:465)
        at org.xnio.nio.QueuedNioTcpServerHandle.handleReady(QueuedNioTcpServerHandle.java:38)
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:559)

      The lock is held by another xnio worker thread:

      "XNIO-2 I/O-7" #26 prio=5 os_prio=0 tid=0x00007fd27126c000 nid=0x7e0d runnable [0x00007fd262b9b000]
      java.lang.Thread.State: RUNNABLE
      at sun.nio.ch.EPollArrayWrapper.$$YJP$$epollWait(Native Method)
      at sun.nio.ch.EPollArrayWrapper.epollWait(EPollArrayWrapper.java)
      at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
      at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93)
      at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)

      • locked <0x00000005cd8325e8> (a sun.nio.ch.Util$2)
      • locked <0x00000005cd8325d8> (a java.util.Collections$UnmodifiableSet)
      • locked <0x00000005cd829370> (a sun.nio.ch.EPollSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:101)
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:509)

        1. nio-stack.txt
          72 kB
          Karsten Sperling
        2. Screen Shot 2016-03-05 at 3.03.01 pm.png
          239 kB
          Karsten Sperling
        3. Screen Shot 2016-03-05 at 3.10.00 pm.png
          279 kB
          Karsten Sperling

              dlloyd@redhat.com David Lloyd
              ksperling Karsten Sperling (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: