Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-57558

Update Confluence Server to use Tomcat 9.0.13 to address Tomcat SecureNioChannel Bug

    XMLWordPrintable

Details

    Description

      Summary

      Tomcat <9.0.13 is affected to the bug where SecureNioChannel fails with "IllegalArgumentException: You can only read using the application read buffer provided by the handler."

      This is a Tomcat bug as per http://tomcat.10.x6.nabble.com/Bug-62791-New-SecureNioChannel-fails-with-quot-IllegalArgumentException-You-can-only-read-using-the--td5078457.html

      The following log appears in tomcat.log:

      27-Oct-2018 11:27:46.492 SEVERE [https-jsse-nio-8446-exec-32] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Error reading request, ignored
       java.lang.IllegalArgumentException: You can only read using the application read buffer provided by the handler.
      	at org.apache.tomcat.util.net.SecureNioChannel.read(SecureNioChannel.java:571)
      	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1204)
      	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1140)
      	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:72)
      	at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171)
      	at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151)
      	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
      	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      

      Symptoms

      • Increased heap usage after GC processing and GC activity potentially leading to performance issues.

       

      • If a heap dump is taken, an analysis will show two leak suspects like the following occupying most of the heap:
      13,548 instances of "org.apache.tomcat.websocket.WsSession", loaded by "java.net.URLClassLoader @ 0x5c09f4598" occupy 2,160,380,648 (51.26%) bytes.
      
      Keywords
      java.net.URLClassLoader @ 0x5c09f4598
      org.apache.tomcat.websocket.WsSession
      

      and

      6,774 instances of "org.apache.tomcat.websocket.WsFrameClient", loaded by "java.net.URLClassLoader @ 0x5c09f4598" occupy 894,276,384 (21.22%) bytes. These instances are referenced from one instance of "java.util.HashMap$Node[]", loaded by "<system class loader>"
      
      Keywords
      org.apache.tomcat.websocket.WsFrameClient
      java.net.URLClassLoader @ 0x5c09f4598
      java.util.HashMap$Node[]
      

      Workaround

      • Use Http11Nio2Protocol instead of Http11NioProtocol within the appropriate connector of the server.xml file

      Attachments

        Issue Links

          Activity

            People

              qpham@atlassian.com Quan Pham
              mkhairuliana Monique Khairuliana (Inactive)
              Votes:
              8 Vote for this issue
              Watchers:
              26 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: