activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Fernandez (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AMQ-1511) Slave starts connectors before master fails
Date Thu, 13 Mar 2008 20:42:32 GMT

     [ https://issues.apache.org/activemq/browse/AMQ-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joe Fernandez updated AMQ-1511:
-------------------------------

    Attachment: patchfile.txt

Attached is a proposed svn diff patch for this issue. With this patch, a slave broker in a
pure master/slave configuration will not open transports, connectors, bridges, proxies, etc.
while it is attached to its master. Also, a broker will fail to  start if you configure it
to have more than one masterConnector. The code was there to prevent this, but was broken.
 

> Slave starts connectors before master fails
> -------------------------------------------
>
>                 Key: AMQ-1511
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1511
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.1.1
>            Reporter: Howard Orner
>            Assignee: Rob Davies
>         Attachments: patchfile.txt
>
>
> A broker configured as a slave starts its connectors before the the master fails.  This
is bad because a) The documentation states that this is not the case.  b) it shouldn't be
the case because you don't want clients to be able to connect to the slave until it takes
over as master.
> In looking at source, it would appear that the MasterConnector of BrokerService is not
started until after all the connections are started in startAllConnection().  Unfortunately,
to determine if connections should be started, isSlave() is called which relies on the MasterConnector.start()
method being called.  
> The MasterConnector service start() method needs to be called first before isSlave will
work.
> See broken code snippet from BrokerService below:
> protected void startAllConnectors() throws Exception{
>   if (!isSlave()){   // OOPS!!! isSlave asks the MasterConnector if the master is active,
but can't until its started 
>     ...
>        if (services != null) {
>                 for (int i = 0; i < services.length; i++) {
>                     Service service = services[i];   //OOPS, MasterConnector is in this
list and the surrounding if relies on it to be started
>                     configureService(service);
>                     service.start();   //OOPS!!!!   this should have been called for
isSlave() to return the right answer.
>                 }
>             }
>    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message