-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/55576/
-----------------------------------------------------------

(Updated Feb. 17, 2017, 10:51 a.m.)


Review request for mesos, Benjamin Bannier, Benjamin Hindman, and Joris Van 
Remoortere.


Bugs: MESOS-6907
    https://issues.apache.org/jira/browse/MESOS-6907


Repository: mesos


Description (updated)
-------

Fixed a flakiness in `FutureTest.After3` caused by the way
libprocess processes timers. 

Timers are executed in batch and also discarded in batch, 
so if a given timer's thunk is executed as the first of its
batch, the callback and all objects in the callback will
be kept around until the last timer's thunk in the batch
is executed.

To get around the issue, we ensure that the first batch
is executed, by waiting on the timer's `Future` to be set,
then schedule a second timer and wait until it begins to
be executed.

Note that a solution based in `Clock` would not work since
the timers are executed in, either `libev` or `libevent` 
loops for which libprocess has no control over.


Diffs
-----

  3rdparty/libprocess/src/tests/future_tests.cpp 
380755f9a2329d548969cfb2332c79aacbf7fff2 

Diff: https://reviews.apache.org/r/55576/diff/


Testing
-------

```sh
# Put the machine under stress.
$ stress -c 4 -t 2600 -d 2 -i 2 &
$ ./${MESOS_SRC_ROOT}/build/3rdparty/libprocess/libprocess-tests \
      --gtest_filter="FutureTest.After3" --gtest_repeat=1000000 
--gtest_break_on_failure
$ ./${MESOS_SRC_ROOT}/build/build/src/mesos-tests
```


Thanks,

Alexander Rojas

Reply via email to