f24325c wdmd: preemptive close before test fails

Authored and Committed by teigland 12 years ago
    wdmd: preemptive close before test fails
    
    Instead of closing the device when a test fails, close
    it TEST_INTERVAL (10 sec) before the test fails.  This
    is done so that the watchdog will fire at most 60 sec
    after the expire time (between 50 and 60 seconds instead
    of between 60 and 70 seconds which would be the case
    if we close at the expiration time; see previous commit).
    
    The timeouts in sanlock have been based on the assumption
    that the watchdog device fires at most 60 seconds after
    the expiration time, so it's best to maintain that
    expectation.
    
    The pre-emptive close and re-open generate pings, so
    they are used in place of ordinary pings.
    
    If the expire time is at T45, and is renewed/extended
    at T46, then the sequence of pings would be:
    
    T10 - ping from ioctl
    T20 - ping from ioctl
    T30 - ping from ioctl
    T40 - ping from close
    T50 - ping from re-open
    T60 - ping from ioctl
    ...
    
    If the expire time was *not* renewed, then the watchdog
    would fire at T100; which is 55 seconds after the
    expiration time.  55 is between the desired 50-60 second
    interveral.
    
    Signed-off-by: David Teigland <teigland@redhat.com>
    
        
file modified
+6 -3
file modified
+33 -1