[Neo-report] r2722 jm - /trunk/neo/master/handlers/election.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 20 17:20:23 CEST 2011


Author: jm
Date: Wed Apr 20 17:20:23 2011
New Revision: 2722

Log:
election: fix a case where the primary has wrong state information about another master

Modified:
    trunk/neo/master/handlers/election.py

Modified: trunk/neo/master/handlers/election.py
==============================================================================
--- trunk/neo/master/handlers/election.py [iso-8859-1] (original)
+++ trunk/neo/master/handlers/election.py [iso-8859-1] Wed Apr 20 17:20:23 2011
@@ -172,13 +172,10 @@ class ServerElectionHandler(MasterHandle
     def reelectPrimary(self, conn):
         raise ElectionFailure, 'reelection requested'
 
-    def peerBroken(self, conn):
-        app = self.app
-        addr = conn.getAddress()
-        node = app.nm.getByAddress(addr)
-        if node is not None and node.getUUID() is not None:
-            node.setBroken()
-        MasterHandler.peerBroken(self, conn)
+    def connectionLost(self, conn, new_state):
+        node = self.app.nm.getByUUID(conn.getUUID())
+        if node is not None:
+            node.setState(new_state)
 
     def requestIdentification(self, conn, node_type,
                                         uuid, address, name):




More information about the Neo-report mailing list