Author: borges
Date: 2011-08-10 11:39:03 -0400 (Wed, 10 Aug 2011)
New Revision: 11182
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java
Log:
HORNETQ-720 Fix delay cancelation, fixes FailoverTest.testFailoverOnInitialConnection()
Modified:
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java
===================================================================
---
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java 2011-08-10
15:05:24 UTC (rev 11181)
+++
branches/HORNETQ-720_Replication/tests/integration-tests/src/test/java/org/hornetq/tests/integration/cluster/util/BackupSyncDelay.java 2011-08-10
15:39:03 UTC (rev 11182)
@@ -82,6 +82,7 @@
private Packet onHold;
private Channel channel;
public volatile boolean deliver;
+ private boolean receivedUpToDate;
private boolean mustHold = true;
public void addSubHandler(ReplicationEndpoint handler)
@@ -91,6 +92,10 @@
public synchronized void deliver()
{
+ deliver = true;
+ if (!receivedUpToDate)
+ return;
+
if (onHold == null)
{
throw new NullPointerException("Don't have the 'sync is
done' packet to deliver");
@@ -131,8 +136,9 @@
if (packet.getType() == PacketImpl.REPLICATION_SYNC && mustHold)
{
ReplicationJournalFileMessage syncMsg =
(ReplicationJournalFileMessage)packet;
- if (syncMsg.isUpToDate())
+ if (syncMsg.isUpToDate() && !deliver)
{
+ receivedUpToDate = true;
assert onHold == null;
onHold = packet;
PacketImpl response = new ReplicationResponseMessage();
Show replies by date