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 2017/02/09 00:36:25 UTC

[3/5] mesos git commit: Added TODOs to make the agent code safer.

Added TODOs to make the agent code safer.

The executor and tasks fields in the agent's structs are publicly
visible, but yet for correctness it is required that callers made
modifications through the member functions which carry additional
logic (e.g. tracking allocated resources). The TODO here is to
make these private and to provide public views that are const.

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


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

Branch: refs/heads/master
Commit: 55ca1072a716b4496e795c871840e2ef942489a8
Parents: 348c06b
Author: Benjamin Mahler <bm...@apache.org>
Authored: Tue Feb 7 18:19:40 2017 -0800
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Wed Feb 8 16:36:02 2017 -0800

----------------------------------------------------------------------
 src/slave/slave.hpp | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/55ca1072/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 5049eb7..75dde73 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -988,6 +988,10 @@ struct Executor
   Resources resources;
 
   // Tasks can be found in one of the following four data structures:
+  //
+  // TODO(bmahler): Make these private to enforce that the task
+  // lifecycle helper functions are not being bypassed, and provide
+  // public views into them.
 
   // Not yet launched tasks. This also includes tasks from `queuedTaskGroups`.
   LinkedHashMap<TaskID, TaskInfo> queuedTasks;
@@ -1072,6 +1076,13 @@ struct Framework
   // sent through the master.
   Option<process::UPID> pid;
 
+  // Executors can be found in one of the following
+  // data structures:
+  //
+  // TODO(bmahler): Make these private to enforce that
+  // the executors lifecycle helper functions are not
+  // being bypassed, and provide public views into them.
+
   // Executors with pending tasks.
   hashmap<ExecutorID, hashmap<TaskID, TaskInfo>> pending;