You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by qi...@apache.org on 2018/09/05 21:36:53 UTC

[mesos] 02/03: Made checker library retry to remove the previous check container.

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

qianzhang pushed a commit to branch 1.7.x
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 6499aaf34890690e0ea3606b19fdb83d608bca35
Author: Qian Zhang <zh...@gmail.com>
AuthorDate: Wed Aug 29 11:22:41 2018 +0800

    Made checker library retry to remove the previous check container.
    
    Previously when checker library fails to remove the previous check
    container, it will discard the promise and launch a new check container
    which will cause two problems:
      1. The discarded promise is used to launch the new check container,
         that means even the new check container is launched successfully,
         we still have no chance to process its check result since the
         promise has already been discarded.
      2. The previous check container will never get a chance to be removed
         which is leak, i.e., its runtime directory and sandbox directory
         will not be removed.
    
    Now in this patch, when checker library fails to remove the previous
    check container, we make it remove the previous check container again.
    
    Review: https://reviews.apache.org/r/68555
---
 src/checks/checker_process.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/checks/checker_process.cpp b/src/checks/checker_process.cpp
index 21af9b6..c214bd1 100644
--- a/src/checks/checker_process.cpp
+++ b/src/checks/checker_process.cpp
@@ -658,10 +658,10 @@ Future<int> CheckerProcess::nestedCommandCheck(
                        << " the " << name << " for task '" << taskId << "'";
 
           promise->discard();
+        } else {
+          previousCheckContainerId = None();
+          _nestedCommandCheck(promise, cmd, nested);
         }
-
-        previousCheckContainerId = None();
-        _nestedCommandCheck(promise, cmd, nested);
       }));
   } else {
     _nestedCommandCheck(promise, cmd, nested);