From cc8050efba878ea8615afb18b065760105e25fe7 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 18 Jul 2014 18:18:42 +0000 Subject: QPID-5888: transaction should always be aborted on failover C++ and python clients were attempting to continue the transation transparently after failover which is in correct. They were re-sending messages in the transaction but there is no way to re-do transactional receives. The transaction must be aborted. The C++ and python clients have been modified to kill a transactional session with a TransactionAborted exception if there is a failover. Note the Java client already behaves correctly but not identically. It defers raising an exception until commit rather than failing immediately on failover, and the session can still be used. The following commits are involved: r1611349 QPID-5887: revised approach to implict abort r1610959 QPID-5887: allow qpid-txtest2 to be run by make test r1610958 QPID-5887: fix to new txtest2, acknowledge messages in the check phase to ensure queues remain drained for any subsequent runs r1609748 QPID-5887: abort transactional session on failover; added equivalent of txtest using messaging API This commit does the following: - Update ha_tests.py tx_simpler_failover test to expect transaction aborted. - Minor improvements to qpid-txtest2 - Fix native (non-swig) python client. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1611748 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/messaging/driver.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qpid/python') diff --git a/qpid/python/qpid/messaging/driver.py b/qpid/python/qpid/messaging/driver.py index 6f1d0fba7d..6110befc69 100644 --- a/qpid/python/qpid/messaging/driver.py +++ b/qpid/python/qpid/messaging/driver.py @@ -676,6 +676,12 @@ class Engine: def close(self, e=None): self._reset() + # We cannot re-establish transactional sessions, they must be aborted. + # We could re-do transactional enqueues, but not dequeues. + for ssn in self.connection.sessions.values(): + if ssn.transactional: + ssn.error = TransactionAborted("Transaction aborted due to transport failure") + ssn.closed = True if e: self.connection.error = e self._status = CLOSED -- cgit v1.2.1