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

Clear transaction informations by master notification only.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2112 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 97824328
...@@ -21,7 +21,7 @@ from neo.handler import EventHandler ...@@ -21,7 +21,7 @@ from neo.handler import EventHandler
from neo import protocol from neo import protocol
from neo.util import dump from neo.util import dump
from neo.exception import PrimaryFailure, OperationFailure from neo.exception import PrimaryFailure, OperationFailure
from neo.protocol import NodeStates, Packets, Errors from neo.protocol import NodeStates, NodeTypes, Packets, Errors
class BaseMasterHandler(EventHandler): class BaseMasterHandler(EventHandler):
...@@ -57,6 +57,10 @@ class BaseMasterHandler(EventHandler): ...@@ -57,6 +57,10 @@ class BaseMasterHandler(EventHandler):
self.app.shutdown(erase=erase) self.app.shutdown(erase=erase)
elif state == NodeStates.HIDDEN: elif state == NodeStates.HIDDEN:
raise OperationFailure raise OperationFailure
elif node_type == NodeTypes.CLIENT and state != NodeStates.RUNNING:
logging.info('Notified of non-running client, abort (%r)',
dump(uuid))
self.app.tm.abortFor(uuid)
class BaseClientAndStorageOperationHandler(EventHandler): class BaseClientAndStorageOperationHandler(EventHandler):
......
...@@ -32,7 +32,6 @@ class ClientOperationHandler(BaseClientAndStorageOperationHandler): ...@@ -32,7 +32,6 @@ class ClientOperationHandler(BaseClientAndStorageOperationHandler):
def connectionLost(self, conn, new_state): def connectionLost(self, conn, new_state):
uuid = conn.getUUID() uuid = conn.getUUID()
self.app.tm.abortFor(uuid)
node = self.app.nm.getByUUID(uuid) node = self.app.nm.getByUUID(uuid)
assert node is not None, conn assert node is not None, conn
self.app.nm.remove(node) self.app.nm.remove(node)
......
...@@ -70,7 +70,6 @@ class StorageClientHandlerTests(NeoTestBase): ...@@ -70,7 +70,6 @@ class StorageClientHandlerTests(NeoTestBase):
self.app.nm.createClient(uuid=uuid) self.app.nm.createClient(uuid=uuid)
conn = self._getConnection(uuid=uuid) conn = self._getConnection(uuid=uuid)
self.operation.connectionClosed(conn) self.operation.connectionClosed(conn)
self._checkTransactionsAborted(uuid)
def test_18_askTransactionInformation1(self): def test_18_askTransactionInformation1(self):
# transaction does not exists # transaction does not exists
......
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