Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-20130

[GSS](7.2.z) WFCORE-5105 - ProtocolConnectionUtils may leak connection objects whose future takes too long to complete

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • 7.2.10.GA
    • 7.2.8.GA
    • Management
    • None
    • Hide

      -Start a domain master
      -Connect a domain slave
      -Use the following to induce a pause in the domain master:

      kill -STOP $DOMAIN_MASTER_PID
      

      -Note repeating retries on the slave:

      INFO  [org.jboss.as.host.controller] (Host Controller Service Threads - 464) WFLYHC0150: Trying to reconnect to master host controller.
      

      -After some time capture a heap dump, and check connection accumulation. With an OQL in MAT, these can be pulled easily like so:

      SELECT socketChannel.localAddress.holder.addr.holder.address, socketChannel.localAddress.holder.port, socketChannel.remoteAddress.holder.addr.holder.address, socketChannel.remoteAddress.holder.port FROM org.xnio.nio.NioSocketConduit 
      
      Show
      -Start a domain master -Connect a domain slave -Use the following to induce a pause in the domain master: kill -STOP $DOMAIN_MASTER_PID -Note repeating retries on the slave: INFO [org.jboss.as.host.controller] (Host Controller Service Threads - 464) WFLYHC0150: Trying to reconnect to master host controller. -After some time capture a heap dump, and check connection accumulation. With an OQL in MAT, these can be pulled easily like so: SELECT socketChannel.localAddress.holder.addr.holder.address, socketChannel.localAddress.holder.port, socketChannel.remoteAddress.holder.addr.holder.address, socketChannel.remoteAddress.holder.port FROM org.xnio.nio.NioSocketConduit

    Description

      ProtocolConnectionUtils.connectSync calls remoting to connect and receives an IoFuture<Connection>, which it then waits on for, by default, 5 seconds. If the future completes or fails, it's fine. But if it times out connectSync throws an exception without first cancelling the future. This means remoting has no idea the connection isn't going to be used and if the connection ends up getting established it leaks via the chain WorkerThread -> selector -> table of SelectorKeys maintained by Selector -> NioSocketConduit -> NioSocketStreamConnection.

      This has the potential to leak the connection on the other side as well, since if the connection was successfully established but never used or closed down by the initiating side it can just sit there.

      One place where this can be more problematic is a remote HostController re-connecting to the DomainController after the HC successfully started but then the connection was lost. The HC will loop continually trying to connect. If this problem keeps happening the leaked connection objects will accumulate.

      Attachments

        Issue Links

          Activity

            People

              rhn-support-ivassile Ilia Vassilev
              rhn-support-bmaxwell Brad Maxwell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: