You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2016/07/18 16:11:30 UTC
mesos git commit: Fixed the incomplete `TaskStatus` message of docker
executor.
Repository: mesos
Updated Branches:
refs/heads/master 32a10d6f8 -> cca92ceac
Fixed the incomplete `TaskStatus` message of docker executor.
When we enable health check for the tasks run in docker container,
their `TaskStatus` messages generated by docker executor may miss
`NetworkInfo` field and agent would fill the host ip as default value.
In this change, we cache the `NetworkInfo` of the task and reuse it
when generating `TaskStatus` messages which the task's health is
updated.
Review: https://reviews.apache.org/r/50103/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cca92cea
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cca92cea
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cca92cea
Branch: refs/heads/master
Commit: cca92ceac75c7639c4ae93660b3bb15cce11c5c3
Parents: 32a10d6
Author: haosdent huang <ha...@gmail.com>
Authored: Mon Jul 18 18:01:42 2016 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Mon Jul 18 18:01:42 2016 +0200
----------------------------------------------------------------------
src/docker/executor.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/cca92cea/src/docker/executor.cpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 6951104..16260d7 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -201,6 +201,8 @@ public:
NetworkInfo::IPAddress* ipAddress = networkInfo->add_ip_addresses();
ipAddress->set_ip_address(container.ipAddress.get());
+
+ containerNetworkInfo = *networkInfo;
}
driver->sendStatusUpdate(status);
}
@@ -295,6 +297,12 @@ protected:
status.mutable_task_id()->CopyFrom(taskID);
status.set_healthy(healthy);
status.set_state(TASK_RUNNING);
+
+ if (containerNetworkInfo.isSome()) {
+ status.mutable_container_status()->add_network_infos()->CopyFrom(
+ containerNetworkInfo.get());
+ }
+
driver.get()->sendStatusUpdate(status);
if (initiateTaskKill) {
@@ -575,6 +583,7 @@ private:
Option<ExecutorDriver*> driver;
Option<FrameworkInfo> frameworkInfo;
Option<TaskID> taskId;
+ Option<NetworkInfo> containerNetworkInfo;
};