Uploaded image for project: 'ActiveMQ .Net'
  1. ActiveMQ .Net
  2. AMQNET-241

NMS Failover causes CPU utilization to spike if ActiveMQ is stopped.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.3.0
    • ActiveMQ
    • None
    • .NET 3.5

    • Patch Available
    • Regression

    Description

      1) Configure a simple program that attempts to connect to ActiveMQ with the url "activemq:failover:(tcp://localhost:61616)"
      2) Make sure activemq is not running on the local host
      3) Try to connect.
      4) Notice that the CPU utilization in the sample program is high.
      5) Start ActiveMQ.
      6) Notice that the connection is successful but the CPU utilization remains high.

      Expected:
      I expect, potentially, an initial spike in CPU utilization but not sustained high CPU.

      Diagnosis:

      In FailoverTransport.DoConnect() there is the following if statement:

      if(ConnectedTransport != null || disposed || connectionFailure != null)

      { return false; }

      else

      it apears that connectionFailure is set and never reset. Then the FailoverTask.Iterate() calls into DoConnect only to return false immediately every time.

      I have attached a patch, but I would be uncomfortable calling it a long term solution as I've not had the time to fully understand the code in question. However, it seems to improve the behavior.

      Attachments

        1. NmsRepro_clean.zip
          4 kB
          Ted Carroll
        2. NMS_Failover_CPU_Spike1.patch
          1 kB
          Ted Carroll

        Issue Links

          Activity

            People

              tabish Timothy A. Bish
              tcarroll Ted Carroll
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: