From 8833dcb81764d17b43405c3a6e2c77c408d572dc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 11 May 2016 13:24:33 -0400 Subject: [PATCH] Extend session keepalive Since the keepalive is retried, there's no reason to try to be as frequent as half the specified interval. The spec allows inactivity timeout as short as 57 seconds, so the keepalive interval is extended to 50-55 (allowing some room for retry to hit in case of dropped packet). Change-Id: I3b08f2cad1f319759cd0cc54a8793ec16d88d82e --- pyghmi/ipmi/private/session.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index a7231041..15e088d2 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -835,7 +835,7 @@ class Session(object): if (self in Session.keepalive_sessions and not needskeepalive and not self._customkeepalives): Session.keepalive_sessions[self]['timeout'] = _monotonic_time() + \ - 25 + (random.random() * 4.9) + 50 + (random.random() * 4.9) self._xmit_packet(retry, delay_xmit=delay_xmit, timeout=timeout) def _ipmi15authcode(self, payload, checkremotecode=False): @@ -947,7 +947,7 @@ class Session(object): Session.keepalive_sessions[self] = {} Session.keepalive_sessions[self]['ipmisession'] = self Session.keepalive_sessions[self]['timeout'] = _monotonic_time() + \ - 25 + (random.random() * 4.9) + 50 + (random.random() * 4.9) self.onlogon({'success': True}) def _get_session_challenge(self): @@ -1074,7 +1074,7 @@ class Session(object): # until incommand is no longer the case if parms['timeout'] < curtime and not session._isincommand(): cls.keepalive_sessions[session]['timeout'] = \ - _monotonic_time() + 25 + (random.random() * 4.9) + _monotonic_time() + 50 + (random.random() * 4.9) sessionstokeepalive.append(session) for session in sessionstokeepalive: session._keepalive()