2
0
mirror of https://opendev.org/x/pyghmi synced 2025-08-21 18:40:20 +00:00

Stop spurious retry on incoming data

When data came in from a BMC before acking a recent
transmit, pyghmi would pessimistically take that as
a cue that the data was missed in transit.  However,
if the data happens to be on the wire before an ack
that is coming, this is a senseless retry.  This
retry happens typically within a few milliseconds of
the original.  Fix this by ignoring the non-ACK related
data as a cue for doing a retransmit.

Change-Id: I871377da0265a5e258baf922252ae86df6c578b0
This commit is contained in:
Jarrod Johnson
2015-10-21 15:07:38 -04:00
parent 9103d554e0
commit cf351d1806

View File

@@ -351,9 +351,15 @@ class Console(object):
self._sendpendingoutput()
if len(self.pendingoutput) > 0:
self._sendpendingoutput()
elif self.awaitingack: # session marked us as happy, but we are not
#this does mean that we will occasionally retry a packet
#sooner than retry suggests, but that's no big deal
elif ackseq != 0 and self.awaitingack:
# if an ack packet came in, but did not match what we
# expected, retry our payload now.
# the situation that was triggered was a senseless retry
# when data came in while we xmitted. In theory, a BMC
# should handle a retry correctly, but some do not, so
# try to mitigate by avoiding overeager retries
# occasional retry of a packet
# sooner than timeout suggests is evidently a big deal
self.send_payload(payload=self.lastpayload)
def main_loop(self):