Commit 4c79f0b7 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Remove disconnected clients from storage's node manager.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2069 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 49c8ddd6
......@@ -26,7 +26,11 @@ class ClientOperationHandler(BaseClientAndStorageOperationHandler):
return self.app.dm.getObject(oid, serial, tid)
def connectionLost(self, conn, new_state):
self.app.tm.abortFor(conn.getUUID())
uuid = conn.getUUID()
self.app.tm.abortFor(uuid)
node = self.app.nm.getByUUID(uuid)
assert node is not None, conn
self.app.nm.remove(node)
def abortTransaction(self, conn, tid):
self.app.tm.abort(tid)
......
......@@ -67,6 +67,7 @@ class StorageClientHandlerTests(NeoTestBase):
def test_connectionLost(self):
uuid = self.getNewUUID()
self.app.nm.createClient(uuid=uuid)
conn = self._getConnection(uuid=uuid)
self.operation.connectionClosed(conn)
self._checkTransactionsAborted(uuid)
......
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