summaryrefslogtreecommitdiff
path: root/qpid/python
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2014-07-18 18:18:42 +0000
committerAlan Conway <aconway@apache.org>2014-07-18 18:18:42 +0000
commitcc8050efba878ea8615afb18b065760105e25fe7 (patch)
treeabea502915c40258dac9d3f82f8ca1ac0e88374f /qpid/python
parent0e259111b19f2972933b9fb80070b1c4872c450e (diff)
downloadqpid-python-cc8050efba878ea8615afb18b065760105e25fe7.tar.gz
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
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/messaging/driver.py6
1 files changed, 6 insertions, 0 deletions
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