Author: ataylor
Date: 2011-10-13 08:34:32 -0400 (Thu, 13 Oct 2011)
New Revision: 11530
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
moved creating backup server locator to constructo to avoid race condition on close
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-13
09:54:50 UTC (rev 11529)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-10-13
12:34:32 UTC (rev 11530)
@@ -241,6 +241,10 @@
clusterConnector = new StaticClusterConnector(tcConfigs);
+ backupServerLocator = clusterConnector.createServerLocator(false);
+ backupServerLocator.setReconnectAttempts(-1);
+ backupServerLocator.setInitialConnectAttempts(-1);
+
if (tcConfigs != null && tcConfigs.length > 0)
{
// a cluster connection will connect to other nodes only if they are directly
connected
@@ -340,6 +344,10 @@
clusterConnector = new DiscoveryClusterConnector(dg);
+ backupServerLocator = clusterConnector.createServerLocator(false);
+ backupServerLocator.setReconnectAttempts(-1);
+ backupServerLocator.setInitialConnectAttempts(-1);
+
this.manager = manager;
}
@@ -450,12 +458,6 @@
public void announceBackup()
{
- this.backupServerLocator = clusterConnector.createServerLocator(false);
-
- backupServerLocator.setReconnectAttempts(-1);
- backupServerLocator.setInitialConnectAttempts(-1);
-
-
executor.execute(new Runnable()
{
public void run()
Show replies by date