Commit 2d1f4090 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Remove notifyDeadNode from client app because it's no more used. The client node

never send notifyNodeInformation packets to the master (and don't need to do
this), so remove the associated method handler on the master side and thus
remove an XXX.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1082 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 04d6a839
...@@ -306,20 +306,6 @@ class Application(object): ...@@ -306,20 +306,6 @@ class Application(object):
self._nm_acquire = lock.acquire self._nm_acquire = lock.acquire
self._nm_release = lock.release self._nm_release = lock.release
def notifyDeadNode(self, conn):
""" Notify a storage failure to the primary master """
s_node = self.nm.getNodeByServer(conn.getAddress())
if s_node is None or not s_node.isStorage():
return
s_uuid = s_node.getUUID()
m_conn = self._getMasterConnection()
m_conn.lock()
try:
node_list = [(protocol.STORAGE_NODE_TYPE, s_node.getServer(), s_uuid, s_node.getState())]
m_conn.notify(protocol.notifyNodeInformation(node_list))
finally:
m_conn.unlock()
def _waitMessage(self, target_conn = None, msg_id = None, handler=None): def _waitMessage(self, target_conn = None, msg_id = None, handler=None):
"""Wait for a message returned by the dispatcher in queues.""" """Wait for a message returned by the dispatcher in queues."""
local_queue = self.local_var.queue local_queue = self.local_var.queue
......
...@@ -74,20 +74,6 @@ class ClientServiceHandler(BaseServiceHandler): ...@@ -74,20 +74,6 @@ class ClientServiceHandler(BaseServiceHandler):
if t.getConnection() is conn: if t.getConnection() is conn:
del app.finishing_transaction_dict[tid] del app.finishing_transaction_dict[tid]
def handleNotifyNodeInformation(self, conn, packet, node_list):
for node_type, addr, uuid, state in node_list:
# XXX: client must notify only about storage failures, so remove
# this assertion when done
assert node_type == protocol.STORAGE_NODE_TYPE
assert state in (protocol.TEMPORARILY_DOWN_STATE, protocol.BROKEN_STATE)
node = self.app.nm.getNodeByUUID(uuid)
assert node is not None
if self.app.em.getConnectionByUUID(uuid) is None:
# trust this notification only if I don't have a connexion to
# this node
node.setState(state)
self.app.broadcastNodeInformation(node)
def handleAbortTransaction(self, conn, packet, tid): def handleAbortTransaction(self, conn, packet, tid):
try: try:
del self.app.finishing_transaction_dict[tid] del self.app.finishing_transaction_dict[tid]
......
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