Commit 02fea1d5 authored by Vincent Pelletier's avatar Vincent Pelletier

Make notifyDeadStorage callable for any kind of node (and rename it to notifyDeadNode).

For now, it's a no-op for any non-storage node.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@761 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 26f0f7e4
...@@ -282,10 +282,10 @@ class Application(object): ...@@ -282,10 +282,10 @@ class Application(object):
self._nm_acquire = lock.acquire self._nm_acquire = lock.acquire
self._nm_release = lock.release self._nm_release = lock.release
def notifyDeadStorage(self, conn): def notifyDeadNode(self, conn):
""" Notify a storage failure to the primary master """ """ Notify a storage failure to the primary master """
s_node = self.nm.getNodeByServer(conn.getAddress()) s_node = self.nm.getNodeByServer(conn.getAddress())
if s_node is None: if s_node is None or node.getType() != STORAGE_NODE_TYPE:
return return
s_uuid = s_node.getUUID() s_uuid = s_node.getUUID()
ip_address, port = s_node.getServer() ip_address, port = s_node.getServer()
...@@ -312,7 +312,7 @@ class Application(object): ...@@ -312,7 +312,7 @@ class Application(object):
conn, packet = local_queue.get() conn, packet = local_queue.get()
# check fake packet # check fake packet
if packet is None: if packet is None:
self.notifyDeadStorage(conn) self.notifyDeadNode(conn)
if conn.getUUID() == target_conn.getUUID(): if conn.getUUID() == target_conn.getUUID():
raise NEOStorageConnectionFailure('connection closed') raise NEOStorageConnectionFailure('connection closed')
else: else:
......
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