You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by gr...@apache.org on 2018/02/01 06:20:40 UTC

[04/12] mesos git commit: Added an extra CHECK to `Master::acknowledge()`.

Added an extra CHECK to `Master::acknowledge()`.

The acknowledge call is validated before being passed to
`Master::acknowledge`, so it is safe to assume that `acknowledge.uuid()`
will be valid.

Added a CHECK to detect problems in the validation code or changes in
the code paths.

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


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

Branch: refs/heads/master
Commit: fccdba9af710fe9a32b0de245df31ad959851167
Parents: 0c794bd
Author: Gaston Kleiman <ga...@mesosphere.io>
Authored: Wed Jan 31 12:59:34 2018 -0800
Committer: Greg Mann <gr...@gmail.com>
Committed: Wed Jan 31 18:14:23 2018 -0800

----------------------------------------------------------------------
 src/master/master.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fccdba9a/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index e5ee53a..35f4d6f 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -5746,7 +5746,10 @@ void Master::acknowledge(
 
   const SlaveID& slaveId = acknowledge.slave_id();
   const TaskID& taskId = acknowledge.task_id();
-  const id::UUID uuid = id::UUID::fromBytes(acknowledge.uuid()).get();
+
+  Try<id::UUID> uuid_ = id::UUID::fromBytes(acknowledge.uuid());
+  CHECK_SOME(uuid_);
+  const id::UUID uuid = uuid_.get();
 
   Slave* slave = slaves.registered.get(slaveId);