Author: borges
Date: 2011-11-02 12:16:14 -0400 (Wed, 02 Nov 2011)
New Revision: 11632
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
Log:
Synchronize replicationLock while clearing pendingTokens
Modified:
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java
===================================================================
---
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2011-11-02
14:41:27 UTC (rev 11631)
+++
trunk/hornetq-core/src/main/java/org/hornetq/core/replication/impl/ReplicationManagerImpl.java 2011-11-02
16:16:14 UTC (rev 11632)
@@ -72,8 +72,6 @@
private final ResponseHandler responseHandler = new ResponseHandler();
- private CoreRemotingConnection replicatingConnection;
-
private final Channel replicatingChannel;
private boolean started;
@@ -167,9 +165,8 @@
/* (non-Javadoc)
* @see org.hornetq.core.replication.ReplicationManager#appendCommitRecord(byte, long,
boolean)
*/
- public
- void
- appendCommitRecord(final byte journalID, final long txID, boolean sync, final
boolean lineUp) throws Exception
+ public void appendCommitRecord(final byte journalID, final long txID, boolean sync,
final boolean lineUp)
+ throws Exception
{
if (enabled)
{
@@ -205,7 +202,8 @@
/* (non-Javadoc)
* @see org.hornetq.core.replication.ReplicationManager#appendPrepareRecord(byte,
long, org.hornetq.core.journal.EncodingSupport, boolean)
*/
- public void appendPrepareRecord(final byte journalID, final long txID, final
EncodingSupport transactionData) throws Exception
+ public void appendPrepareRecord(final byte journalID, final long txID, final
EncodingSupport transactionData)
+ throws Exception
{
if (enabled)
{
@@ -321,6 +319,8 @@
return;
}
+ synchronized (replicationLock)
+ {
enabled = false;
// Complete any pending operations...
@@ -337,7 +337,7 @@
ReplicationManagerImpl.log.warn("Error completing callback on
replication manager", e);
}
}
-
+ }
if (replicatingChannel != null)
{
replicatingChannel.close();
Show replies by date