The python reconnect library attempted to send a probe every 0
milliseconds instead of disabling probing when the probe_interval
was zero.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
return LLONG_MAX;
case S_IDLE:
return LLONG_MAX;
case S_IDLE:
- return fsm->state_entered + fsm->probe_interval;
+ if (fsm->probe_interval) {
+ return fsm->state_entered + fsm->probe_interval;
+ }
+ return LLONG_MAX;
case S_RECONNECT:
return fsm->state_entered;
case S_RECONNECT:
return fsm->state_entered;
@staticmethod
def deadline(fsm):
@staticmethod
def deadline(fsm):
- return fsm.state_entered + fsm.probe_interval
+ if fsm.probe_interval:
+ return fsm.state_entered + fsm.probe_interval
+ return None
@staticmethod
def run(fsm, now):
@staticmethod
def run(fsm, now):
connection is indeed in working order. (This will only be
returned if the "probe interval" is nonzero--see
self.set_probe_interval())."""
connection is indeed in working order. (This will only be
returned if the "probe interval" is nonzero--see
self.set_probe_interval())."""
- if now >= self.state.deadline(self):
+
+ deadline = self.state.deadline(self)
+ if deadline is not None and now >= deadline:
return self.state.run(self, now)
else:
return None
return self.state.run(self, now)
else:
return None