summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-11-06 11:12:06 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-11-06 11:12:06 +0000
commit95f5d827b48e5ac49a5ded1bc9c6482de3ebbe42 (patch)
tree253b902b2a1086ec1fdba5d59193861565d3eb1c
parent6a05d876c5f1e9975ea62b30da0ed7c663019c16 (diff)
downloadqpid-python-95f5d827b48e5ac49a5ded1bc9c6482de3ebbe42.tar.gz
QPID-663 Messages fail to be received after fail over. This is due to the old protocol session being reinstated after fail over. The new protocol session needs to be set in the StateManager as this maintains its own reference which is not being updated hence messages are being lost.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@592373 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java b/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
index 5303993331..60f95bfe33 100644
--- a/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
+++ b/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
@@ -48,10 +48,10 @@ import java.util.concurrent.CountDownLatch;
* <ol>
* <li>Sets the failing over condition to true.</li>
* <li>Creates a {@link FailoverException} and gets the protocol connection handler to propagate this event to all
- * interested parties.</li>
+ * interested parties.</li>
* <li>Takes the failover mutex on the protocol connection handler.</li>
* <li>Abandons the fail over if any of the interested parties vetoes it. The mutex is released and the condition
- * reset.</li>
+ * reset.</li>
* <li>Creates a new {@link AMQStateManager} and re-established the connection through it.</li>
* <li>Informs the AMQConnection if the connection cannot be re-established.</li>
* <li>Recreates all sessions from the old connection to the new.</li>
@@ -64,17 +64,14 @@ import java.util.concurrent.CountDownLatch;
* </table>
*
* @todo The failover latch and mutex are used like a lock and condition. If the retrotranlator supports lock/condition
- * then could change over to using them. 1.4 support still needed.
- *
+ * then could change over to using them. 1.4 support still needed.
* @todo If the condition is set to null on a vetoes fail-over and there are already other threads waiting on the
- * condition, they will never be released. It might be an idea to reset the condition in a finally block.
- *
+ * condition, they will never be released. It might be an idea to reset the condition in a finally block.
* @todo Creates a {@link AMQDisconnectedException} and passes it to the AMQConnection. No need to use an
- * exception-as-argument here, could just as easily call a specific method for this purpose on AMQConnection.
- *
+ * exception-as-argument here, could just as easily call a specific method for this purpose on AMQConnection.
* @todo Creates a {@link FailoverException} and propagates it to the MethodHandlers. No need to use an
- * exception-as-argument here, could just as easily call a specific method for this purpose on
- * {@link org.apache.qpid.protocol.AMQMethodListener}.
+ * exception-as-argument here, could just as easily call a specific method for this purpose on
+ * {@link org.apache.qpid.protocol.AMQMethodListener}.
*/
public class FailoverHandler implements Runnable
{
@@ -182,6 +179,7 @@ public class FailoverHandler implements Runnable
}
else
{
+ existingStateManager.setProtocolSession(_amqProtocolHandler.getProtocolSession());
_amqProtocolHandler.setStateManager(existingStateManager);
try
{