Author: aconway
Date: Wed Apr 23 21:11:08 2014
New Revision: 1589520

URL: http://svn.apache.org/r1589520
Log:
QPID-5720: HA exception raised by the store for durable transactions

Running qpid-txtest against a HA cluster was raising this exception:
async_dequeue() failed: jexception 0x0b02 wmgr::dequeue_check() threw 
JERR_MAP_LOCKED: Record ID locked by a pending transaction.

This is actually a test bug. In a cluster a transaction commit takes longer to
complete because of co-ordinating with backups, the test was not waiting for the
completion of commit command before proceeding. Adding a sync() in the test
solves the problem.  Note this test uses the old obsolete C++ API. Applications
written using the supported messaging API are not affected by this. This can be
verified using the qpid-send and qpid-receive clients with the --tx option
(there is already an automated test for this in ha_tests.py.)

Modified:
    qpid/trunk/qpid/cpp/src/tests/brokertest.py
    qpid/trunk/qpid/cpp/src/tests/ha_tests.py
    qpid/trunk/qpid/cpp/src/tests/qpid-txtest.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/brokertest.py
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/brokertest.py?rev=1589520&r1=1589519&r2=1589520&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/brokertest.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/brokertest.py Wed Apr 23 21:11:08 2014
@@ -218,6 +218,9 @@ class Popen(subprocess.Popen):
         self._cleanup()
         return ret
 
+    def assert_exit_ok(self):
+        if self.wait() != 0: self.unexpected("Exit code %d" % self.returncode)
+
     def terminate(self):
         try: subprocess.Popen.terminate(self)
         except AttributeError:          # No terminate method

Modified: qpid/trunk/qpid/cpp/src/tests/ha_tests.py
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ha_tests.py?rev=1589520&r1=1589519&r2=1589520&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ha_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/ha_tests.py Wed Apr 23 21:11:08 2014
@@ -1551,15 +1551,13 @@ class TransactionTests(HaBrokerTest):
         for t in threads: t.join()
         for s in sessions: s.connection.close()
 
-    def test_broker_tx_tests(self):
+    def test_other_tx_tests(self):
         cluster = HaCluster(self, 3)
-        print "Running python broker tx tests"
-        p = subprocess.Popen(["qpid-python-test",
-                              "-m", "qpid_tests.broker_0_10",
-                              "-b", "localhost:%s"%(cluster[0].port()),
-                              "*.tx.*"])
-        assert not p.wait()
-        print "Finished python broker tx tests"
+        self.popen(["qpid-txtest", "-p%s"%cluster[0].port()]).assert_exit_ok()
+        self.popen(["qpid-python-test",
+                    "-m", "qpid_tests.broker_0_10",
+                    "-b", "localhost:%s"%(cluster[0].port()),
+                    "*.tx.*"]).assert_exit_ok()
 
 if __name__ == "__main__":
     outdir = "ha_tests.tmp"

Modified: qpid/trunk/qpid/cpp/src/tests/qpid-txtest.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpid-txtest.cpp?rev=1589520&r1=1589519&r2=1589520&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/qpid-txtest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/qpid-txtest.cpp Wed Apr 23 21:11:08 2014
@@ -179,6 +179,7 @@ struct Transfer : public Client, public 
                 } else {
                     session.txCommit();
                 }
+                session.sync();
             }
         } catch(const std::exception& e) {
             std::cout << "Transfer interrupted: " << e.what() << std::endl;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to