From de58593f146e94bd272c06166ef6fe2cd1db7ffc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 7 Aug 2018 15:12:53 -0400 Subject: [PATCH] Fix inability to notice underlying broken layers of the SOL Through an unknown set of circumstances, an solconnection could be stuck 'connecting'. In every case analyzed, the ipmi_session was broken. Use that to detect a class of failure and react appropriately. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 1824203c..1f6276dc 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -270,17 +270,20 @@ class IpmiConsole(conapi.Console): kg=self.kg, force=True, iohandler=self.handle_data) self.solconnection.outputlock = NullLock() - while not self.solconnection.connected and not self.broken: + while (not self.solconnection.connected and + not (self.broken or self.solconnection.connected or + self.solconnection.ipmi_session.broken)): w = eventlet.event.Event() _ipmiwaiters.append(w) - w.wait() - if self.broken: - break - if self.broken: + w.wait(15) + if (self.broken or self.solconnection.connected or + self.solconnection.ipmi_session.broken): if (self.error.startswith('Incorrect password') or self.error.startswith('Unauthorized name')): raise exc.TargetEndpointBadCredentials else: + if not self.error: + self.error = 'Unknown error' raise exc.TargetEndpointUnreachable(self.error) self.connected = True except socket.gaierror as err: