Commit fcecacd2 authored by Vincent Pelletier's avatar Vincent Pelletier

Prepare notifyDeadStorage to be callable from outside app.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@757 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bb077977
...@@ -282,8 +282,9 @@ class Application(object): ...@@ -282,8 +282,9 @@ 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, s_node): def notifyDeadStorage(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())
if s_node is None: if s_node is None:
return return
s_uuid = s_node.getUUID() s_uuid = s_node.getUUID()
...@@ -311,8 +312,7 @@ class Application(object): ...@@ -311,8 +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:
s_node = self.nm.getNodeByServer(conn.getAddress()) self.notifyDeadStorage(conn)
self._notifyDeadStorage(s_node)
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