Uploaded image for project: 'ActiveMQ C++ Client'
  1. ActiveMQ C++ Client
  2. AMQCPP-491

Connection didn't switch to the slave broker when the master broker is down

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.7.0
    • 3.7.1, 3.8.0
    • Transports
    • None
    • Windows 7, VS2010

    • Patch Available

    Description

      Master/Slave configuration with a shared data directory:
      ActiveMQ Configuration (activemq.xml):
      <persistenceAdapter>
      <kahaDB directory="\\host1\kahadb"/>
      </persistenceAdapter>

      URL:
      failover:(tcp://host1:port1,tcp://host2:port2)?randomize=false

      Test case:
      1) Run ActiveMQ on host2, it becomes the master
      2) Run ActiveMQ on host1, it becomes the slave
      3) Run a program that opens an ActiveMQ connection with the url
      4) Shutdown ActiveMQ on host2
      5) The ActiveMQ connection is not able to switch to host1.

      Explanation:
      The test case has randomize=false to be able to reproduce the problem anytime. If randomize=true, the problem occurs randomly.

      At step 3, ActiveMQ-CPP tries to open first a connection with host1. It fails as host1 is the slave. Then it tries to open a connection with host2. This time, it succeeds but it forgets to put back the failure hosts (host1) to the broker list. At this point, the broker list = (host2).

      At step 5, ActiveMQ-CPP tries to open a connection with the broker list. As the broker list = (host2), it will try to open a connection only with host2.

      Attachments

        1. FailoverTransport.cpp.patch
          0.5 kB
          Daniel Laügt

        Activity

          People

            tabish Timothy A. Bish
            dlaugt Daniel Laügt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified