[ 
https://issues.apache.org/jira/browse/MESOS-952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13884968#comment-13884968
 ] 

Benjamin Mahler commented on MESOS-952:
---------------------------------------

This updates the semantics: https://reviews.apache.org/r/17480/
Only 1 spot in Mesos needed fixing: https://reviews.apache.org/r/17481/

> 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
>            Assignee: 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)

Reply via email to