From ff3d56620d77555c87759647c3b2c5d8d404711e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 29 Jan 2014 15:34:47 -0500 Subject: [PATCH] Fix keepalive behavior on broken Sessions If a Session object is broken (e.g. BMC goes away or network outage), then its keepalive timer would cause an application to be starved of being able to do any IPMI related work. Address this scenario by having the instance deregister its keepalive at the point it reports itself as broken. Change-Id: I6b7af8ad03759c676110fb4f0b7bfa41642152f3 --- pyghmi/ipmi/private/session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 83a2226d..9460c02d 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -1151,6 +1151,9 @@ class Session(object): self.ipmicallback(response) self.incommand = False self.nowait = False + # since our connection has failed retries + # deregister our keepalive facility + Session.keepalive_sessions.pop(self, None) return elif self.sessioncontext == 'FAILED': self.nowait = False