This is an automated email from the ASF dual-hosted git repository.

bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 6bc1c80  Fixed the flaky ExamplesTest.DynamicReservationFramework.
6bc1c80 is described below

commit 6bc1c809dfcbcb62ca09e09ea9acb628e7a36738
Author: Benjamin Mahler <bmah...@apache.org>
AuthorDate: Fri Apr 19 16:14:03 2019 -0400

    Fixed the flaky ExamplesTest.DynamicReservationFramework.
    
    The test failed in MESOS-5804 due to the following race:
    
      1. Framework launches task T, moves from RESERVED to
         TASK_RUNNING state.
      2. Allocation cycle triggers and will send the unreserved
         resources to the framework.
      3. Before the offer gets to the framework, task T finishes and
         framework moves from TASK_RUNNING to RESERVED.
      4. In the RESERVED state, the framework expects the reservation
         in the offer. But, it's coming in a later offer, and the one
         that arrives is for the unreserved resources since it was
         generated while the task was still running.
    
    Tne fix applied here for this specific race is to use a 2 week
    filter rather than a 0 second filter. That would ensure that the
    unreserved resources do not get re-offered to the framework on
    their own. However, this fix does not work until MESOS-9616 is
    resolved.
    
    Review: https://reviews.apache.org/r/70508
---
 src/examples/dynamic_reservation_framework.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/examples/dynamic_reservation_framework.cpp 
b/src/examples/dynamic_reservation_framework.cpp
index f9c7dfe..094d805 100644
--- a/src/examples/dynamic_reservation_framework.cpp
+++ b/src/examples/dynamic_reservation_framework.cpp
@@ -115,7 +115,7 @@ public:
       const State state = states[offer.slave_id()];
 
       Filters filters;
-      filters.set_refuse_seconds(0);
+      filters.set_refuse_seconds(Weeks(2).secs());
 
       switch (state) {
         case State::INIT: {

Reply via email to