Updated the executor driver to set TaskStatus.uuid. Review: https://reviews.apache.org/r/35910
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/a964bec3 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/a964bec3 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/a964bec3 Branch: refs/heads/master Commit: a964bec3bd85f109d479c69f6d7e21da881c3be5 Parents: 4b591a0 Author: Benjamin Mahler <[email protected]> Authored: Thu Jun 25 22:58:55 2015 -0700 Committer: Benjamin Mahler <[email protected]> Committed: Mon Jun 29 10:01:27 2015 -0700 ---------------------------------------------------------------------- src/exec/exec.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/a964bec3/src/exec/exec.cpp ---------------------------------------------------------------------- diff --git a/src/exec/exec.cpp b/src/exec/exec.cpp index 930dda9..a1ae074 100644 --- a/src/exec/exec.cpp +++ b/src/exec/exec.cpp @@ -499,17 +499,23 @@ protected: update->mutable_status()->MergeFrom(status); update->set_timestamp(Clock::now().secs()); update->mutable_status()->set_timestamp(update->timestamp()); - update->set_uuid(UUID::random().toBytes()); message.set_pid(self()); - // Incoming status update might come from an executor which has not set - // slave id in TaskStatus. Set/overwrite slave id. + // We overwrite the UUID for this status update, however with + // the HTTP API, the executor will have to generate a UUID + // (which needs to be validated to be RFC-4122 compliant). + UUID uuid = UUID::random(); + update->set_uuid(uuid.toBytes()); + update->mutable_status()->set_uuid(uuid.toBytes()); + + // We overwrite the SlaveID for this status update, however with + // the HTTP API, this can be overwritten by the slave instead. update->mutable_status()->mutable_slave_id()->CopyFrom(slaveId); VLOG(1) << "Executor sending status update " << *update; // Capture the status update. - updates[UUID::fromBytes(update->uuid())] = *update; + updates[uuid] = *update; send(slave, message); }
