You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2019/01/10 18:36:06 UTC

[mesos] 08/08: Fixed flaky check in cluster::Slave destructor.

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

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

commit 9862262956d4a8f5e32c1267c2e0b36f41f7fc73
Author: Benno Evers <be...@mesosphere.com>
AuthorDate: Wed Jan 9 14:32:30 2019 -0800

    Fixed flaky check in cluster::Slave destructor.
    
    The destructor of `cluster::Slave` contained an assertion
    that was not safe to assume in the presence of the
    composing containerizer. This commit adds an additional
    `Clock::settle()` to fix the issue.
    
    Review: https://reviews.apache.org/r/69436/
---
 src/tests/cluster.cpp | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/tests/cluster.cpp b/src/tests/cluster.cpp
index 4ad7c0b..6148984 100644
--- a/src/tests/cluster.cpp
+++ b/src/tests/cluster.cpp
@@ -688,8 +688,19 @@ Slave::~Slave()
       }
     }
 
-    if (paused) {
-      process::Clock::pause();
+    // When using the composing containerizer, the assertion checking
+    // `containers->empty()` below is racy, since the containers are
+    // not yet removed from that containerizer's internal data structures
+    // when the future becomes ready. Instead, an internal function to clean
+    // up these internal data structures is dispatched when the future
+    // becomes ready.
+    // To work around this, we wait for the clock to settle here. This can
+    // be removed once MESOS-9413 is resolved.
+    process::Clock::pause();
+    process::Clock::settle();
+
+    if (!paused) {
+      process::Clock::resume();
     }
 
     containers = containerizer->containers();