2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-16 04:38:19 +00:00

Use different timeout values for logon and retry

When establishing a session, there is not much to lose.
If three get channel authentication capabilities fail, it's
almost certainly because it just isn't going to work (bad IP,
rebooting BMC, something like that).  However, once signs of life
have been displayed, the likely cause of an outage shifts toward
a transient network outage (e.g. link speed negotiation after
rebooting a shared nic configured solution).  Particularly with SOL,
there is a high chance of inflight data worth trying to recover the
session to get.  For that we go to tolerating up to ~20 seconds of
outage.  Much longer than that and we are pretty much certain to run
afoul of BMC timeout anyway, so no hope of withstanding something like
spanning tree with blocking by default, but it can withstand moderately
well configured networks.

Change-Id: I783d13eaee4360cfd780e28b2b4cbf77cc980945
This commit is contained in:
Jarrod Johnson 2014-02-01 19:02:18 -05:00
parent 79efa5e1b4
commit 02848d66b7

View File

@ -218,6 +218,7 @@ class Session(object):
else:
self.iterwaiters.append(onlogon)
return
self.maxtimeout = 3 # be aggressive about giving up on initial packet
self.incommand = False
self.initialized = True
self.cleaningup = False
@ -576,6 +577,7 @@ class Session(object):
if 'error' in response:
self.onlogon(response)
return
self.maxtimeout = 6 # we have a confirmed bmc, be more tenacious
if response['code'] == 0xcc and self.ipmi15only is not None:
# tried ipmi 2.0 against a 1.5 which should work, but some bmcs
# thought 'reserved' meant 'must be zero'
@ -1169,7 +1171,7 @@ class Session(object):
return
self.nowait = True
self.timeout += 1
if self.timeout > 5:
if self.timeout > self.maxtimeout:
response = {'error': 'timeout'}
self.ipmicallback(response)
self.incommand = False