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

Fix a potential bug source, where the node retreived by an UUID could be None if

there are connections in identification state.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1024 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 019d55c5
...@@ -309,19 +309,20 @@ class Application(object): ...@@ -309,19 +309,20 @@ class Application(object):
logging.debug('broadcastPartitionChanges') logging.debug('broadcastPartitionChanges')
self.pt.log() self.pt.log()
for c in self.em.getConnectionList(): for c in self.em.getConnectionList():
if c.getUUID() is not None: n = self.nm.getNodeByUUID(c.getUUID())
n = self.nm.getNodeByUUID(c.getUUID()) if n is None:
if n.isClient() or n.isStorage() or n.isAdmin(): continue
# Split the packet if too big. if n.isClient() or n.isStorage() or n.isAdmin():
size = len(cell_list) # Split the packet if too big.
start = 0 size = len(cell_list)
while size: start = 0
amt = min(10000, size) while size:
p = protocol.notifyPartitionChanges(ptid, amt = min(10000, size)
cell_list[start:start+amt]) cell_list = cell_list[start:start+amt]
c.notify(p) p = protocol.notifyPartitionChanges(ptid, cell_list)
size -= amt c.notify(p)
start += amt size -= amt
start += amt
def outdateAndBroadcastPartition(self): def outdateAndBroadcastPartition(self):
" Outdate cell of non-working nodes and broadcast changes """ " Outdate cell of non-working nodes and broadcast changes """
......
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