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):
logging.debug('broadcastPartitionChanges')
self.pt.log()
for c in self.em.getConnectionList():
if c.getUUID() is not None:
n = self.nm.getNodeByUUID(c.getUUID())
if n.isClient() or n.isStorage() or n.isAdmin():
# Split the packet if too big.
size = len(cell_list)
start = 0
while size:
amt = min(10000, size)
p = protocol.notifyPartitionChanges(ptid,
cell_list[start:start+amt])
c.notify(p)
size -= amt
start += amt
n = self.nm.getNodeByUUID(c.getUUID())
if n is None:
continue
if n.isClient() or n.isStorage() or n.isAdmin():
# Split the packet if too big.
size = len(cell_list)
start = 0
while size:
amt = min(10000, size)
cell_list = cell_list[start:start+amt]
p = protocol.notifyPartitionChanges(ptid, cell_list)
c.notify(p)
size -= amt
start += amt
def outdateAndBroadcastPartition(self):
" 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