You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2016/09/27 04:21:11 UTC

[05/11] mesos git commit: Populated the timestamp field when sending status updates.

Populated the timestamp field when sending status updates.

The command executor/default executor were not populating
the timestamp for the status update. Previously, the executor
driver used to do it underneath but that won't work with using
the HTTP command executor.

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


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

Branch: refs/heads/master
Commit: 0451bda6c808ba7565f4e76bb1318c50a84463ca
Parents: 1ee637a
Author: Anand Mazumdar <an...@apache.org>
Authored: Mon Sep 26 21:13:42 2016 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Mon Sep 26 21:20:39 2016 -0700

----------------------------------------------------------------------
 src/launcher/default_executor.cpp    | 3 +++
 src/launcher/executor.cpp            | 1 +
 src/tests/default_executor_tests.cpp | 1 +
 3 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/0451bda6/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp b/src/launcher/default_executor.cpp
index 2102fe8..73520a7 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -24,6 +24,7 @@
 #include <mesos/v1/executor.hpp>
 #include <mesos/v1/mesos.hpp>
 
+#include <process/clock.hpp>
 #include <process/defer.hpp>
 #include <process/delay.hpp>
 #include <process/id.hpp>
@@ -43,6 +44,7 @@ using mesos::executor::Event;
 
 using mesos::v1::executor::Mesos;
 
+using process::Clock;
 using process::Owned;
 
 using std::cout;
@@ -261,6 +263,7 @@ private:
     status.set_state(state);
     status.set_source(TaskStatus::SOURCE_EXECUTOR);
     status.set_uuid(uuid.toBytes());
+    status.set_timestamp(Clock::now().secs());
 
     if (message.isSome()) {
       status.set_message(message.get());

http://git-wip-us.apache.org/repos/asf/mesos/blob/0451bda6/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index e2ff1a8..8a1051b 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -727,6 +727,7 @@ private:
     status.set_state(state);
     status.set_source(TaskStatus::SOURCE_EXECUTOR);
     status.set_uuid(uuid.toBytes());
+    status.set_timestamp(Clock::now().secs());
 
     if (healthy.isSome()) {
       status.set_healthy(healthy.get());

http://git-wip-us.apache.org/repos/asf/mesos/blob/0451bda6/src/tests/default_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index 786fbe3..4465106 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -143,6 +143,7 @@ TEST_F(DefaultExecutorTest, TaskRunning)
   ASSERT_EQ(TASK_RUNNING, update->status().state());
   EXPECT_EQ(taskInfo.task_id(), update->status().task_id());
   EXPECT_TRUE(update->status().healthy());
+  EXPECT_TRUE(update->status().has_timestamp());
 }