You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2013/12/13 00:09:34 UTC

[2/2] git commit: Fixed a bug in the task status accounting.

Fixed a bug in the task status accounting.

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


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

Branch: refs/heads/bmahler_fixed_task_statuses
Commit: c52c8cc4af40a83f493eff617911a3abfeb0c85e
Parents: 280895f
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Wed Dec 11 11:55:07 2013 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Thu Dec 12 14:43:07 2013 -0800

----------------------------------------------------------------------
 src/master/master.cpp | 2 +-
 src/slave/slave.cpp   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c52c8cc4/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index cb8e613..dd61119 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1553,7 +1553,7 @@ void Master::statusUpdate(const StatusUpdate& update, const UPID& pid)
 
   // TODO(brenden) Consider wiping the `data` and `message` fields?
   if (task->statuses_size() > 0 &&
-      task->statuses(task->statuses_size() - 1).state() == task->state()) {
+      task->statuses(task->statuses_size() - 1).state() == status.state()) {
     task->mutable_statuses()->RemoveLast();
   }
   task->add_statuses()->CopyFrom(status);

http://git-wip-us.apache.org/repos/asf/mesos/blob/c52c8cc4/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 9a8b82f..6e6107e 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -3285,7 +3285,7 @@ void Executor::updateTaskState(const TaskStatus& status)
     Task* task = launchedTasks[status.task_id()];
     // TODO(brenden): Consider wiping the `data` and `message` fields?
     if (task->statuses_size() > 0 &&
-        task->statuses(task->statuses_size() - 1).state() == task->state()) {
+        task->statuses(task->statuses_size() - 1).state() == status.state()) {
       task->mutable_statuses()->RemoveLast();
     }
     task->add_statuses()->CopyFrom(status);


Re: [2/2] git commit: Fixed a bug in the task status accounting.

Posted by Benjamin Mahler <be...@gmail.com>.
I accidentally pushed my branch out to apache, sorry about that! Will clean
it up.


On Thu, Dec 12, 2013 at 3:09 PM, <bm...@apache.org> wrote:

> Fixed a bug in the task status accounting.
>
> Review: https://reviews.apache.org/r/16188
>
>
> Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
> Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c52c8cc4
> Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c52c8cc4
> Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c52c8cc4
>
> Branch: refs/heads/bmahler_fixed_task_statuses
> Commit: c52c8cc4af40a83f493eff617911a3abfeb0c85e
> Parents: 280895f
> Author: Benjamin Mahler <bm...@twitter.com>
> Authored: Wed Dec 11 11:55:07 2013 -0800
> Committer: Benjamin Mahler <bm...@twitter.com>
> Committed: Thu Dec 12 14:43:07 2013 -0800
>
> ----------------------------------------------------------------------
>  src/master/master.cpp | 2 +-
>  src/slave/slave.cpp   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/c52c8cc4/src/master/master.cpp
> ----------------------------------------------------------------------
> diff --git a/src/master/master.cpp b/src/master/master.cpp
> index cb8e613..dd61119 100644
> --- a/src/master/master.cpp
> +++ b/src/master/master.cpp
> @@ -1553,7 +1553,7 @@ void Master::statusUpdate(const StatusUpdate&
> update, const UPID& pid)
>
>    // TODO(brenden) Consider wiping the `data` and `message` fields?
>    if (task->statuses_size() > 0 &&
> -      task->statuses(task->statuses_size() - 1).state() == task->state())
> {
> +      task->statuses(task->statuses_size() - 1).state() ==
> status.state()) {
>      task->mutable_statuses()->RemoveLast();
>    }
>    task->add_statuses()->CopyFrom(status);
>
>
> http://git-wip-us.apache.org/repos/asf/mesos/blob/c52c8cc4/src/slave/slave.cpp
> ----------------------------------------------------------------------
> diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
> index 9a8b82f..6e6107e 100644
> --- a/src/slave/slave.cpp
> +++ b/src/slave/slave.cpp
> @@ -3285,7 +3285,7 @@ void Executor::updateTaskState(const TaskStatus&
> status)
>      Task* task = launchedTasks[status.task_id()];
>      // TODO(brenden): Consider wiping the `data` and `message` fields?
>      if (task->statuses_size() > 0 &&
> -        task->statuses(task->statuses_size() - 1).state() ==
> task->state()) {
> +        task->statuses(task->statuses_size() - 1).state() ==
> status.state()) {
>        task->mutable_statuses()->RemoveLast();
>      }
>      task->add_statuses()->CopyFrom(status);
>
>