Commit f9824313 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix issue where the admin node crash when it try to connect first to a master

that's not the primary.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@830 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 225a11ce
......@@ -26,7 +26,7 @@ from neo.connection import ListeningConnection, ClientConnection
from neo.exception import PrimaryFailure
from neo.admin.handler import MasterMonitoringEventHandler, AdminEventHandler, \
MasterBootstrapEventHandler, MasterRequestEventHandler
from neo.connector import getConnectorHandler
from neo.connector import getConnectorHandler, ConnectorConnectionClosedException
from neo import protocol
class Dispatcher:
......@@ -134,7 +134,11 @@ class Application(object):
self.master_conn = None
t = 0
while 1:
em.poll(1)
try:
em.poll(1)
except ConnectorConnectionClosedException:
self.primary_master_node = None
continue
if self.primary_master_node is not None:
# If I know which is a primary master node, check if
# I have a connection to it already.
......@@ -163,7 +167,6 @@ class Application(object):
index = 0
self.trying_master_node = master_list[0]
index += 1
print "connecting to %s:%d" % self.trying_master_node.getServer()
ClientConnection(em, handler, \
addr = self.trying_master_node.getServer(),
connector_handler = self.connector_handler)
......
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