From 26e8e4fdf09ebff5b7783fd4bdd3d41266894161 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 10 Jun 2014 09:22:35 -0400 Subject: [PATCH] Fix infinitely recursing custom keepalives Custom keepalives are called regardless of whether a command is issued or not. The rationale being that custom keepalives are checking for something specific rather than just assuring session state. Notably, SOL uses a custom keepalive to see if the payload is still active. The resultant problem was that if keepalive expired just at the time something was in the midst of a command, a session would infinitely recurse into its own keepalive. The issue was that the keepalive expiry incorrectly omitted _monotonic_time, causing expiry to always be far in the past. It normally did not break because if not incommand, send_payload was setting an appropriate value after the incorrect setting. Change-Id: Ie86e49890a6ac96ddf07206fb1b8558161c00a20 --- pyghmi/ipmi/private/session.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index e9368f87..fb598db2 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -922,8 +922,8 @@ class Session(object): sessionstokeepalive = [] for session, parms in cls.keepalive_sessions.iteritems(): if parms['timeout'] < curtime: - cls.keepalive_sessions[session]['timeout'] = 25 + \ - (random.random() * 4.9) + cls.keepalive_sessions[session]['timeout'] = \ + _monotonic_time() + 25 + (random.random() * 4.9) sessionstokeepalive.append(session) for session in sessionstokeepalive: session._keepalive()