Commit e2b11d54 by Julien Muchembled

admin: fix handling of immediate connection failure to upstream admin

In such case, it didn't reconnect, but thought it was connected,
which eventually led to crashes like:

  Traceback (most recent call last):
    ...
    File "neo/admin/handler.py", line 130, in answerClusterState
      self.app.updateMonitorInformation(None, cluster_state=state)
    File "neo/admin/app.py", line 274, in updateMonitorInformation
      self.upstream_admin_conn.send(Packets.NotifyMonitorInformation(kw))
    File "neo/lib/connection.py", line 565, in send
      raise ConnectionClosed
  neo.lib.connection.ConnectionClosed
1 parent 4d571267
......@@ -240,8 +240,13 @@ class Application(BaseApplication, Monitor):
def connectToUpstreamAdmin(self):
if self.listening_conn: # if running
self.upstream_admin_conn = ClientConnection(
self, self.upstream_admin_handler, self.upstream_admin)
self.upstream_admin_conn = None
while True:
conn = ClientConnection(
self, self.upstream_admin_handler, self.upstream_admin)
if not conn.isClosed():
break
self.upstream_admin_conn = conn
def partitionTableUpdated(self):
pt = self.pt
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!