Commit c5e8de0a authored by Grégory Wisniewski's avatar Grégory Wisniewski

Don't abort a transaction on the master node.

There is nothing to clean on the master side when a client abort a
transaction.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2238 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e5a0261c
......@@ -785,14 +785,6 @@ class Application(object):
logging.error('Exception in tpc_abort while notifying ' \
'storage node %r of abortion, ignoring.', conn, exc_info=1)
# Abort the transaction in the primary master node.
conn = self._getMasterConnection()
try:
conn.notify(p)
except:
logging.error('Exception in tpc_abort while notifying master ' \
'node %r of abortion, ignoring.', conn, exc_info=1)
# Just wait for responses to arrive. If any leads to an exception,
# log it and continue: we *must* eat all answers to not disturb the
# next transaction.
......
......@@ -47,10 +47,6 @@ class ClientServiceHandler(MasterHandler):
conn.notify(Packets.NotifyNodeInformation(node_list))
conn.answer(Packets.AnswerNodeInformation())
def abortTransaction(self, conn, tid):
# nothing to remove.
pass
def askBeginTransaction(self, conn):
"""
A client request a TID, nothing is kept about it until the finish.
......
......@@ -118,24 +118,6 @@ class MasterClientHandlerTests(NeoTestBase):
self.assertEquals(len(txn.getOIDList()), 0)
self.assertEquals(len(txn.getUUIDList()), 1)
def test_11_abortTransaction(self):
service = self.service
# give a bad tid, must not failed, just ignored it
client_uuid = self.identifyToMasterNode(node_type=NodeTypes.CLIENT, port=self.client_port)
conn = self.getFakeConnection(client_uuid, self.client_address)
self.assertFalse(self.app.tm.hasPending())
service.abortTransaction(conn, None)
self.assertFalse(self.app.tm.hasPending())
# give a known tid
conn = self.getFakeConnection(client_uuid, self.client_address)
tid = self.app.tm.getLastTID()
self.app.tm.remove(tid)
self.app.tm.begin(Mock({'__hash__': 1}), tid)
self.assertTrue(self.app.tm.hasPending())
service.abortTransaction(conn, tid)
self.assertFalse(self.app.tm.hasPending())
def test_askNodeInformations(self):
# check that only informations about master and storages nodes are
# send to a client
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment