mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Mahler (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MESOS-952) Clock::resume should adjust timeouts that were created in a paused/advanced Clock context.
Date Tue, 28 Jan 2014 01:46:37 GMT
Benjamin Mahler created MESOS-952:
-------------------------------------

             Summary: Clock::resume should adjust timeouts that were created in a paused/advanced
Clock context.
                 Key: MESOS-952
                 URL: https://issues.apache.org/jira/browse/MESOS-952
             Project: Mesos
          Issue Type: Bug
            Reporter: Benjamin Mahler


When timeouts are created while the Clock is paused and advanced into the future, these must
be adjusted once we resume the Clock.

For example:

Process A {
  initialize() { loop(); }
  loop() { delay(Seconds(1), loop); }
}

// T = 0
Clock::pause();
Clock::advance(Seconds(1)); // T = 1
Clock::settle(); // The loop timeout will be expired, loop() is called.
// loop is scheduled for T = 2
Clock::advance(Seconds(1)); // T = 2
Clock::settle(); // The loop timeout will be expired, loop() is called.
// loop is scheduled for T = 3

Clock::resume(); // T = 0 once again (assume ~ no real time has elapsed)

// Now loop will not be called for 3 seconds, until T = 3.
// Instead, we expect loop to be called at T = 1.

The semantics here can be quite tricky so please let me know if I'm missing something. It
seems we should be adjusting the timers when resuming an advanced clock. 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message