Commit e2b11d54 authored by Julien Muchembled's avatar 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
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
......
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