Commit f80215e1 authored by Vincent Pelletier's avatar Vincent Pelletier

Make ClientServiceHandler inherit from MasterHandler directly.

BaseServiceHandler only logic doesn't apply to a client connection, so
there is no benefit in inheriting from it.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1604 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e37f79c2
......@@ -18,20 +18,25 @@
from neo import logging
from neo.protocol import NodeStates, Packets, ProtocolError
from neo.master.handlers import BaseServiceHandler
from neo.master.handlers import MasterHandler
from neo.util import dump
class ClientServiceHandler(BaseServiceHandler):
class ClientServiceHandler(MasterHandler):
""" Handler dedicated to client during service state """
def connectionCompleted(self, conn):
pass
def nodeLost(self, conn, node):
def connectionLost(self, conn, new_state):
# cancel it's transactions and forgot the node
self.app.tm.abortFor(node)
self.app.nm.remove(node)
app = self.app
node = app.nm.getByUUID(conn.getUUID())
assert node is not None
app.tm.abortFor(node)
node.setState(NodeStates.DOWN)
app.broadcastNodesInformation([node])
app.nm.remove(node)
def abortTransaction(self, conn, tid):
if tid in self.app.tm:
......
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