You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/10/13 00:37:15 UTC

[2/2] mesos git commit: Invoke the shutdown executor callback for checkpointed frameworks.

Invoke the shutdown executor callback for checkpointed frameworks.

Previously, the executor library used to commit suicide after the
recovery timeout without invoking the executor's shutdown callback.
This behavior was not consistent with the executor driver.

Review: https://reviews.apache.org/r/52756/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8b4d83ae
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8b4d83ae
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8b4d83ae

Branch: refs/heads/master
Commit: 8b4d83aecc937996805e553c96f88486bd84ef35
Parents: a1dc1d3
Author: Anand Mazumdar <an...@apache.org>
Authored: Wed Oct 12 17:34:40 2016 -0700
Committer: Vinod Kone <vi...@gmail.com>
Committed: Wed Oct 12 17:37:02 2016 -0700

----------------------------------------------------------------------
 src/executor/executor.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8b4d83ae/src/executor/executor.cpp
----------------------------------------------------------------------
diff --git a/src/executor/executor.cpp b/src/executor/executor.cpp
index a0e5d83..1d47b52 100644
--- a/src/executor/executor.cpp
+++ b/src/executor/executor.cpp
@@ -478,10 +478,7 @@ protected:
       // Backoff and reconnect only if framework checkpointing is enabled.
       backoff();
     } else {
-      Event event;
-      event.set_type(Event::SHUTDOWN);
-
-      receive(event, true);
+      shutdown();
     }
   }
 
@@ -721,12 +718,20 @@ protected:
     }
 
     if (event.type() == Event::SHUTDOWN) {
-      shutdown();
+      _shutdown();
     }
   }
 
   void shutdown()
   {
+    Event event;
+    event.set_type(Event::SHUTDOWN);
+
+    receive(event, true);
+  }
+
+  void _shutdown()
+  {
     if (!local) {
       spawn(new ShutdownProcess(shutdownGracePeriod), true);
     } else {