mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 17:43:14 +00:00
Avoid double-disconnect behavior
Do a better job of cleanly handling scenarios where disconnect would come from a session currently disconnected. Inside the ipmi plugin, suppress a disconnect event if one has been sent. Inside consoleserver, surpress logging a disconnect when already disconnected. Originally was going to skip the reconnect, but that would mitigate recovery. Hopefully supressing the duplicate disconnect in ipmi plugin, and some fixes in pyghmi will avoid a 'double connect' scenario.
This commit is contained in:
parent
b503d9ca11
commit
d19fdad0ba
@ -255,11 +255,12 @@ class ConsoleHandler(object):
|
||||
self._send_rcpts({'connectstate': self.connectstate})
|
||||
|
||||
def _got_disconnected(self):
|
||||
self.connectstate = 'unconnected'
|
||||
self.log(
|
||||
logdata='console disconnected', ltype=log.DataTypes.event,
|
||||
event=log.Events.consoledisconnect)
|
||||
self._send_rcpts({'connectstate': self.connectstate})
|
||||
if self.connectstate != 'unconnected':
|
||||
self.connectstate = 'unconnected'
|
||||
self.log(
|
||||
logdata='console disconnected', ltype=log.DataTypes.event,
|
||||
event=log.Events.consoledisconnect)
|
||||
self._send_rcpts({'connectstate': self.connectstate})
|
||||
if self._isalive:
|
||||
self._connect()
|
||||
|
||||
|
@ -219,6 +219,7 @@ class IpmiConsole(conapi.Console):
|
||||
self.broken = True
|
||||
self.error = data['error']
|
||||
if self.connected:
|
||||
self.connected = False
|
||||
self.datacallback(conapi.ConsoleEvent.Disconnect)
|
||||
else:
|
||||
self.datacallback(data)
|
||||
|
Loading…
Reference in New Issue
Block a user