[1/3] mesos-site git commit: Updated the website built from mesos SHA: 76c38f9.

2018-03-02 Thread git-site-role
Repository: mesos-site
Updated Branches:
  refs/heads/asf-site b54369938 -> ebf501bc5


http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/sitemap.xml
--
diff --git a/content/sitemap.xml b/content/sitemap.xml
index 9ca3ca2..809612e 100644
--- a/content/sitemap.xml
+++ b/content/sitemap.xml
@@ -2,18174 +2,18174 @@
 http://www.sitemaps.org/schemas/sitemap/0.9;>
   
 http://mesos.apache.org/api/latest/java/overview-tree.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 http://mesos.apache.org/api/latest/java/help-doc.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 http://mesos.apache.org/api/latest/java/constant-values.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 http://mesos.apache.org/api/latest/java/allclasses-frame.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 http://mesos.apache.org/api/latest/java/deprecated-list.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 http://mesos.apache.org/api/latest/java/allclasses-noframe.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.TaskState.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.RateLimit.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.CheckInfo.Http.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.SlaveInfo.CapabilityOrBuilder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.Volume.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.LinuxInfo.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.RLimitInfo.RLimit.Type.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.ResourceProviderInfo.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.ContainerInfoOrBuilder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.ParameterOrBuilder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.CgroupInfo.Blkio.Operation.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.CgroupInfo.Blkio.Throttling.Statistics.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.Flag.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.TimeInfo.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.RLimitInfo.RLimit.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.CgroupInfo.Blkio.CFQ.StatisticsOrBuilder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.TTYInfoOrBuilder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.Ports.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.CommandInfo.URI.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.Offer.Operation.DestroyVolume.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.UdpStatistics.Builder.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 
http://mesos.apache.org/api/latest/java/org/apache/mesos/Protos.Operation.html
-2018-03-02T00:00:00+00:00
+2018-03-03T00:00:00+00:00
   
   
 

[3/3] mesos-site git commit: Updated the website built from mesos SHA: 76c38f9.

2018-03-02 Thread git-site-role
Updated the website built from mesos SHA: 76c38f9.


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

Branch: refs/heads/asf-site
Commit: ebf501bc5c906ade10701a81fd878aa9fbc5bd90
Parents: b543699
Author: jenkins 
Authored: Sat Mar 3 00:21:06 2018 +
Committer: jenkins 
Committed: Sat Mar 3 00:21:06 2018 +

--
 content/api/latest/c++/Nodes.xml|5 +
 content/api/latest/c++/Tokens.xml   |   22 +
 content/api/latest/c++/globals_0x75.html|   10 +-
 content/api/latest/c++/index.hhc|1 +
 content/api/latest/c++/index.hhk|  189 +-
 .../api/latest/c++/namespacemembers_0x64.html   |   15 +-
 .../api/latest/c++/namespacemembers_0x66.html   |6 +-
 .../api/latest/c++/namespacemembers_0x68.html   |6 +-
 .../api/latest/c++/namespacemembers_0x6c.html   |6 +-
 .../api/latest/c++/namespacemembers_0x73.html   |   17 +-
 .../api/latest/c++/namespacemembers_0x77.html   |   29 +-
 .../latest/c++/namespacemembers_vars_0x64.html  |3 +
 .../latest/c++/namespacemembers_vars_0x66.html  |6 +-
 .../latest/c++/namespacemembers_vars_0x77.html  |6 +-
 .../namespacemesos_1_1internal_1_1slave.html|   14 +
 .../latest/c++/src_2slave_2constants_8hpp.html  |2 +
 .../c++/src_2slave_2constants_8hpp_source.html  |  120 +-
 content/blog/feed.xml   |2 +-
 .../index.html  |2 +-
 content/sitemap.xml | 9086 +-
 20 files changed, 4808 insertions(+), 4739 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/Nodes.xml
--
diff --git a/content/api/latest/c++/Nodes.xml b/content/api/latest/c++/Nodes.xml
index fe9e967..d222022 100644
--- a/content/api/latest/c++/Nodes.xml
+++ b/content/api/latest/c++/Nodes.xml
@@ -89329,6 +89329,11 @@
   afc0d56cf9f52d4a7422fa0c9833988cc
  
  
+  DOCKER_INSPECT_TIMEOUT
+  src_2slave_2constants_8hpp.html
+  ad212bb9f10c21738fce8eb39c6700b00
+ 
+ 
   DOCKER_PS_MAX_INSPECT_CALLS
   src_2slave_2constants_8hpp.html
   a4224dcfd5af7747e25b91baedeec2b9b

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/Tokens.xml
--
diff --git a/content/api/latest/c++/Tokens.xml 
b/content/api/latest/c++/Tokens.xml
index 4ae4ba2..1d29c85 100644
--- a/content/api/latest/c++/Tokens.xml
+++ b/content/api/latest/c++/Tokens.xml
@@ -27432,6 +27432,17 @@
   
   
 
+  DOCKER_INSPECT_TIMEOUT
+  cpp
+  data
+  mesos::internal::slave
+
+namespacemesos_1_1internal_1_1slave.html
+ad212bb9f10c21738fce8eb39c6700b00
+constants.hpp
+  
+  
+
   DOCKER_PS_MAX_INSPECT_CALLS
   cpp
   data
@@ -89633,6 +89644,17 @@
   
   
 
+  DOCKER_INSPECT_TIMEOUT
+  cpp
+  data
+  mesos::internal::slave
+
+namespacemesos_1_1internal_1_1slave.html
+ad212bb9f10c21738fce8eb39c6700b00
+constants.hpp
+  
+  
+
   DOCKER_PS_MAX_INSPECT_CALLS
   cpp
   data

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/globals_0x75.html
--
diff --git a/content/api/latest/c++/globals_0x75.html 
b/content/api/latest/c++/globals_0x75.html
index d1aebbf..193c565 100644
--- a/content/api/latest/c++/globals_0x75.html
+++ b/content/api/latest/c++/globals_0x75.html
@@ -88,18 +88,18 @@
 UMOUNT_NOFOLLOW
 : fs.hpp
 
-Unimplemented()
-: unimplemented.hpp
-
 UNIMPLEMENTED
 : unimplemented.hpp
 
-UNREACHABLE
-: unreachable.hpp
+Unimplemented()
+: unimplemented.hpp
 
 Unreachable()
 : unreachable.hpp
 
+UNREACHABLE
+: unreachable.hpp
+
 
 
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/index.hhc
--
diff --git a/content/api/latest/c++/index.hhc b/content/api/latest/c++/index.hhc
index 5d05815..cc0f7c7 100644
--- a/content/api/latest/c++/index.hhc
+++ b/content/api/latest/c++/index.hhc
@@ -23534,6 +23534,7 @@
   
   
   
+  
   
   
   

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/index.hhk

[2/3] mesos-site git commit: Updated the website built from mesos SHA: 76c38f9.

2018-03-02 Thread git-site-role
http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/namespacemembers_0x73.html
--
diff --git a/content/api/latest/c++/namespacemembers_0x73.html 
b/content/api/latest/c++/namespacemembers_0x73.html
index 9679ffc..13be1a2 100644
--- a/content/api/latest/c++/namespacemembers_0x73.html
+++ b/content/api/latest/c++/namespacemembers_0x73.html
@@ -194,12 +194,12 @@
 setPromises()
 : process
 
-setuid()
-: os
-
 SETUID
 : mesos::internal::capabilities
 
+setuid()
+: os
+
 setUp()
 : routing::link
 
@@ -237,16 +237,17 @@
 snapshot()
 : process::metrics
 
-Socket
-: process::network::unix
-
 socket()
-: routing
-, net
+: net
 
 Socket
 : process::network
 , process::network::inet
+, process::network::unix
+
+socket()
+: routing
+, net
 
 SOCKET_FILE
 : mesos::internal::slave::containerizer::paths

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/namespacemembers_0x77.html
--
diff --git a/content/api/latest/c++/namespacemembers_0x77.html 
b/content/api/latest/c++/namespacemembers_0x77.html
index cf99cba..0cefa59 100644
--- a/content/api/latest/c++/namespacemembers_0x77.html
+++ b/content/api/latest/c++/namespacemembers_0x77.html
@@ -127,31 +127,30 @@
 : process
 
 write()
-: process::io
-, os::signal_safe
-, mesos::internal::log::protocol
-
-WRITE
-: cgroups::blkio
-
-write()
-: os
+: os
+, mesos::internal::log
+, cgroups
 , protobuf
-, os::signal_safe
 
 WRITE
 : process::io
 
 write()
-: protobuf
-, os
-, mesos::internal::log
+: os::signal_safe
+, mesos::internal::log::protocol
 , protobuf
-, cgroups
-, os
 , os::signal_safe
+, protobuf
 , process::io
 
+WRITE
+: cgroups::blkio
+
+write()
+: process::io
+, os
+, os::signal_safe
+
 write_impl()
 : os::signal_safe
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/namespacemembers_vars_0x64.html
--
diff --git a/content/api/latest/c++/namespacemembers_vars_0x64.html 
b/content/api/latest/c++/namespacemembers_vars_0x64.html
index 453aaee..fbb18a4 100644
--- a/content/api/latest/c++/namespacemembers_vars_0x64.html
+++ b/content/api/latest/c++/namespacemembers_vars_0x64.html
@@ -221,6 +221,9 @@
 DOCKER_INSPECT_DELAY
 : mesos::internal::slave
 
+DOCKER_INSPECT_TIMEOUT
+: mesos::internal::slave
+
 DOCKER_IPv6_NETWORK
 : mesos::internal::tests
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/namespacemembers_vars_0x66.html
--
diff --git a/content/api/latest/c++/namespacemembers_vars_0x66.html 
b/content/api/latest/c++/namespacemembers_vars_0x66.html
index 8de8ff9..f02b6a1 100644
--- a/content/api/latest/c++/namespacemembers_vars_0x66.html
+++ b/content/api/latest/c++/namespacemembers_vars_0x66.html
@@ -97,12 +97,12 @@
 FIN_WAIT2
 : routing::diagnosis::socket::state
 
-flags
-: mesos::internal::tests
-
 FLAGS
 : mesos::internal::build
 
+flags
+: mesos::internal::tests
+
 FORCE_DESTROY_ON_RECOVERY_FILE
 : mesos::internal::slave::containerizer::paths
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/namespacemembers_vars_0x77.html
--
diff --git a/content/api/latest/c++/namespacemembers_vars_0x77.html 
b/content/api/latest/c++/namespacemembers_vars_0x77.html
index 5bf8504..137e1e3 100644
--- a/content/api/latest/c++/namespacemembers_vars_0x77.html
+++ b/content/api/latest/c++/namespacemembers_vars_0x77.html
@@ -106,12 +106,12 @@
 WINDOWS_PATH_SEPARATOR
 : os
 
-WRITE
-: process::io
-
 write
 : mesos::internal::log::protocol
 
+WRITE
+: process::io
+
 
 
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/namespacemesos_1_1internal_1_1slave.html
--
diff --git a/content/api/latest/c++/namespacemesos_1_1internal_1_1slave.html 
b/content/api/latest/c++/namespacemesos_1_1internal_1_1slave.html
index ce065c2..4e45cb6 100644
--- a/content/api/latest/c++/namespacemesos_1_1internal_1_1slave.html
+++ b/content/api/latest/c++/namespacemesos_1_1internal_1_1slave.html
@@ -389,6 +389,8 @@ Variables
 
 constexpr DurationDOCKER_INSPECT_DELAY
 = Seconds(1)
 
+constexpr DurationDOCKER_INSPECT_TIMEOUT
 = Seconds(5)
+
 constexpr size_tDOCKER_PS_MAX_INSPECT_CALLS
 = 100
 
 constexpr DurationDOCKER_VERSION_WAIT_TIMEOUT
 = Seconds(5)
@@ -1457,6 +1459,18 @@ Variables
 
 
 
+
+
+
+  
+
+  constexpr Duration 
mesos::internal::slave::DOCKER_INSPECT_TIMEOUT = Seconds(5)
+
+  
+
+
+
+
 
 
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/ebf501bc/content/api/latest/c++/src_2slave_2constants_8hpp.html

[1/4] mesos git commit: Handled hanging docker `stop`, `inspect` commands in docker executor.

2018-03-02 Thread gilbert
Repository: mesos
Updated Branches:
  refs/heads/master b0a269691 -> 76c38f9d0


Handled hanging docker `stop`, `inspect` commands in docker executor.

Previosly, if `docker inspect` command hanged, the docker container
ended up in an unkillable state. This patch adds a timeout for inspect
command after receiving `killTask` analogically to `reaped` handler.
In addition we've added a timeout for `docker stop` command. If docker
`stop` or `inspect` command times out, we discard the related future,
thus the docker library kills previously spawned docker cli subprocess.
As a result, a scheduler can retry `killTask` operation to handle
nasty docker bugs that lead to hanging docker cli.

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


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

Branch: refs/heads/master
Commit: 32fe39055545a6511c1613be9907cbb3357d86a4
Parents: 8346ab0
Author: Andrei Budnik 
Authored: Fri Mar 2 15:38:59 2018 -0800
Committer: Gilbert Song 
Committed: Fri Mar 2 15:40:30 2018 -0800

--
 src/docker/executor.cpp | 68 ++--
 1 file changed, 47 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/32fe3905/src/docker/executor.cpp
--
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 93c3e1d..8fe8a7c 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -97,7 +97,6 @@ public:
   killed(false),
   terminated(false),
   killedByHealthCheck(false),
-  killingInProgress(false),
   launcherDir(launcherDir),
   docker(docker),
   containerName(containerName),
@@ -323,6 +322,13 @@ public:
 return Nothing();
   }));
 
+inspect
+  .after(DOCKER_INSPECT_TIMEOUT, [=](const Future&) {
+LOG(WARNING) << "Docker inspect has not finished after "
+ << DOCKER_INSPECT_TIMEOUT;
+return inspect;
+  });
+
 inspect.onFailed(defer(self(), [=](const string& failure) {
   LOG(ERROR) << "Failed to inspect container '" << containerName << "'"
  << ": " << failure;
@@ -442,9 +448,8 @@ private:
 // TODO(alexr): If a kill is in progress, consider adjusting
 // the grace period if a new one is provided.
 
-// Issue the kill signal if the container is running
-// and kill attempt is not in progress.
-if (run.isSome() && !killingInProgress) {
+// Issue the kill signal if there was an attempt to launch the container.
+if (run.isSome()) {
   // We have to issue the kill after 'docker inspect' has
   // completed, otherwise we may race with 'docker run'
   // and docker may not know about the container. Note
@@ -453,6 +458,15 @@ private:
   // issued the kill.
   inspect
 .onAny(defer(self(), ::_killTask, _taskId, gracePeriod));
+
+  // If the inspect takes too long we discard it to ensure we
+  // don't wait forever, however in this case there may be no
+  // TASK_RUNNING update.
+  inspect
+.after(DOCKER_INSPECT_TIMEOUT, [=](const Future&) {
+  inspect.discard();
+  return inspect;
+});
 }
   }
 
@@ -463,9 +477,7 @@ private:
 CHECK_SOME(taskId);
 CHECK_EQ(taskId_, taskId.get());
 
-if (!terminated && !killingInProgress) {
-  killingInProgress = true;
-
+if (!terminated) {
   // Once the task has been transitioned to `killed`,
   // there is no way back, even if the kill attempt
   // failed. This also allows us to send TASK_KILLING
@@ -500,28 +512,43 @@ private:
 }
   }
 
+  // If a previous attempt to stop a Docker container is still in progress,
+  // we need to kill the hanging Docker CLI subprocess. Discarding this
+  // future triggers a callback in the Docker library that kills the
+  // subprocess.
+  if (stop.isPending()) {
+LOG(WARNING) << "Previous docker stop has not terminated yet"
+ << " for container '" << containerName << "'";
+stop.discard();
+  }
+
   // TODO(bmahler): Replace this with 'docker kill' so
   // that we can adjust the grace period in the case of
   // a `KillPolicy` override.
+  //
+  // NOTE: `docker stop` may or may not finish. Our behaviour is to give
+  // the subprocess a chance to finish until next time `_killtask` is
+  // invoked. Also, invoking `docker stop` might be unsuccessful, in which
+  // case the container most probably does not receive the signal.
+  // In any case we should 

[3/4] mesos git commit: Added inspect retries to the Docker executor.

2018-03-02 Thread gilbert
Added inspect retries to the Docker executor.

This patch adds retries for `inspect` command to workaround docker
daemon hangs. We assume that the docker daemon can be temporarily
unresponsive. If it's unresponsive, then any started docker cli
command hangs. To address the issue, we retry `inspect` in the loop.

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


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

Branch: refs/heads/master
Commit: 84c3b4c4b22b100644f46b561772732e942ceb49
Parents: 32fe390
Author: Andrei Budnik 
Authored: Fri Mar 2 15:39:05 2018 -0800
Committer: Gilbert Song 
Committed: Fri Mar 2 15:40:31 2018 -0800

--
 src/docker/executor.cpp | 46 +++-
 1 file changed, 37 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/84c3b4c4/src/docker/executor.cpp
--
diff --git a/src/docker/executor.cpp b/src/docker/executor.cpp
index 8fe8a7c..1d67211 100644
--- a/src/docker/executor.cpp
+++ b/src/docker/executor.cpp
@@ -22,8 +22,10 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -215,13 +217,46 @@ public:
 
 run->onAny(defer(self(), ::reaped, lambda::_1));
 
+// Since the Docker daemon might hang, we have to retry the inspect 
command.
+auto inspectLoop = loop(
+self(),
+[=]() {
+  return await(
+  docker->inspect(containerName, DOCKER_INSPECT_DELAY)
+.after(
+DOCKER_INSPECT_TIMEOUT,
+[=](Future future) {
+  LOG(WARNING) << "Docker inspect timed out after "
+   << DOCKER_INSPECT_TIMEOUT
+   << " for container "
+   << "'" << containerName << "'";
+
+  // We need to clean up the hanging Docker CLI process.
+  // Discarding the inspect future triggers a callback in
+  // the Docker library that kills the subprocess and
+  // transitions the future.
+  future.discard();
+  return future;
+}));
+},
+[](const Future& future)
+-> Future {
+  if (future.isReady()) {
+return Break(future.get());
+  }
+  if (future.isFailed()) {
+return Failure(future.failure());
+  }
+  return Continue();
+});
+
 // Delay sending TASK_RUNNING status update until we receive
 // inspect output. Note that we store a future that completes
 // after the sending of the running update. This allows us to
 // ensure that the terminal update is sent after the running
 // update (see `reaped()`).
-inspect = docker->inspect(containerName, DOCKER_INSPECT_DELAY)
-  .then(defer(self(), [=](const Docker::Container& container) {
+inspect =
+  inspectLoop.then(defer(self(), [=](const Docker::Container& container) {
 if (!killed) {
   containerPid = container.pid;
 
@@ -322,13 +357,6 @@ public:
 return Nothing();
   }));
 
-inspect
-  .after(DOCKER_INSPECT_TIMEOUT, [=](const Future&) {
-LOG(WARNING) << "Docker inspect has not finished after "
- << DOCKER_INSPECT_TIMEOUT;
-return inspect;
-  });
-
 inspect.onFailed(defer(self(), [=](const string& failure) {
   LOG(ERROR) << "Failed to inspect container '" << containerName << "'"
  << ": " << failure;



[4/4] mesos git commit: Added inspect retries to the docker containerizer in `update` method.

2018-03-02 Thread gilbert
Added inspect retries to the docker containerizer in `update` method.

This patch fixes the bug when a terminal status update is never sent
after termination of the docker executor, when the Docker daemon hangs
for `inspect` command. A terminal status update is postponed until
containerizer `update` completes that uses `inspect` command to get
a PID of the docker container. To address the issue, we retry `inspect`
in the loop.

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


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

Branch: refs/heads/master
Commit: 76c38f9d03ee6854e6bcd00a959d697472e0ea58
Parents: 84c3b4c
Author: Andrei Budnik 
Authored: Fri Mar 2 15:39:09 2018 -0800
Committer: Gilbert Song 
Committed: Fri Mar 2 15:40:31 2018 -0800

--
 src/slave/constants.hpp|  3 +++
 src/slave/containerizer/docker.cpp | 42 -
 2 files changed, 44 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/76c38f9d/src/slave/constants.hpp
--
diff --git a/src/slave/constants.hpp b/src/slave/constants.hpp
index 030fb05..b79c084 100644
--- a/src/slave/constants.hpp
+++ b/src/slave/constants.hpp
@@ -135,6 +135,9 @@ constexpr Duration DOCKER_REMOVE_DELAY = Hours(6);
 // container.
 constexpr Duration DOCKER_INSPECT_DELAY = Seconds(1);
 
+// Default duration to wait for `inspect` command completion.
+constexpr Duration DOCKER_INSPECT_TIMEOUT = Seconds(5);
+
 // Default maximum number of docker inspect calls docker ps will invoke
 // in parallel to prevent hitting system's open file descriptor limit.
 constexpr size_t DOCKER_PS_MAX_INSPECT_CALLS = 100;

http://git-wip-us.apache.org/repos/asf/mesos/blob/76c38f9d/src/slave/containerizer/docker.cpp
--
diff --git a/src/slave/containerizer/docker.cpp 
b/src/slave/containerizer/docker.cpp
index 1f4eeb4..31d64a7 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -1711,7 +1711,47 @@ Future DockerContainerizerProcess::update(
 return __update(containerId, _resources, container->pid.get());
   }
 
-  return docker->inspect(containers_.at(containerId)->containerName)
+  string containerName = containers_.at(containerId)->containerName;
+
+  // Since the Docker daemon might hang, we have to retry the inspect command.
+  //
+  // NOTE: This code is duplicated from the built-in docker executor, but
+  // the retry interval is not passed to `inspect`, because the container might
+  // be terminated.
+  // TODO(abudnik): Consider using a class helper for retrying docker commands.
+  auto inspectLoop = loop(
+  self(),
+  [=]() {
+return await(
+docker->inspect(containerName)
+  .after(
+  slave::DOCKER_INSPECT_TIMEOUT,
+  [=](Future future) {
+LOG(WARNING) << "Docker inspect timed out after "
+ << slave::DOCKER_INSPECT_TIMEOUT
+ << " for container "
+ << "'" << containerName << "'";
+
+// We need to clean up the hanging Docker CLI process.
+// Discarding the inspect future triggers a callback in
+// the Docker library that kills the subprocess and
+// transitions the future.
+future.discard();
+return future;
+  }));
+  },
+  [](const Future& future)
+  -> Future {
+if (future.isReady()) {
+  return Break(future.get());
+}
+if (future.isFailed()) {
+  return Failure(future.failure());
+}
+return Continue();
+  });
+
+  return inspectLoop
 .then(defer(self(), ::_update, containerId, _resources, lambda::_1));
 #else
   return Nothing();



[2/4] mesos git commit: Avoided orphan subprocess in the Docker library.

2018-03-02 Thread gilbert
Avoided orphan subprocess in the Docker library.

This patch ensures that `Docker::inspect` will not leave orphan
subprocesses behind.

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


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

Branch: refs/heads/master
Commit: 8346ab0c812559ef73e1bbd30718f6c74a023079
Parents: b0a2696
Author: Greg Mann 
Authored: Fri Mar 2 15:39:58 2018 -0800
Committer: Gilbert Song 
Committed: Fri Mar 2 15:40:30 2018 -0800

--
 src/docker/docker.cpp | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/8346ab0c/src/docker/docker.cpp
--
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index 9dd4ceb..bb81c4d 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -1324,6 +1324,13 @@ void Docker::_inspect(
   // Set the `onDiscard` callback which will clean up the subprocess if the
   // caller discards the `Future` that we returned.
   synchronized (callback->second) {
+// It's possible that the caller has discarded their future while we were
+// creating a new subprocess, so we clean up here if necessary.
+if (promise->future().hasDiscard()) {
+  commandDiscarded(s.get(), cmd);
+  return;
+}
+
 callback->first = [promise, s, cmd]() {
   promise->discard();
   CHECK_SOME(s);



mesos-site git commit: Updated the website built from mesos SHA: b0a2696.

2018-03-02 Thread git-site-role
Repository: mesos-site
Updated Branches:
  refs/heads/asf-site 9ca267bef -> b54369938


Updated the website built from mesos SHA: b0a2696.


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

Branch: refs/heads/asf-site
Commit: b54369938fa5706b35ce19163fb4c32028466dba
Parents: 9ca267b
Author: jenkins 
Authored: Fri Mar 2 11:31:05 2018 +
Committer: jenkins 
Committed: Fri Mar 2 11:31:05 2018 +

--
 content/blog/feed.xml | 2 +-
 content/blog/performance-working-group-progress-report/index.html | 2 +-
 content/documentation/latest/configuration/agent/index.html   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos-site/blob/b5436993/content/blog/feed.xml
--
diff --git a/content/blog/feed.xml b/content/blog/feed.xml
index e67b4ef..57ae404 100644
--- a/content/blog/feed.xml
+++ b/content/blog/feed.xml
@@ -295,7 +295,7 @@ To learn more about CSI work in Mesos, you can dig into the 
design document 
 /ul
 
 
-pIf you are a user and would like to suggest some areas for 
performance improvement, please let us know by emailing a 
href=#x6d;#97;#x69;#108;#x74;#x6f;#x3a;#x64;#x65;#118;#x40;#97;#x70;#97;#99;#104;#101;#46;#109;#x65;#x73;#111;#x73;#x2e;#111;#x72;#x67;#x64;#101;#x76;#x40;#x61;#x70;#97;#99;#104;#x65;#x2e;#109;#x65;#x73;#x6f;#x73;#x2e;#x6f;#x72;#x67;/a./p
+pIf you are a user and would like to suggest some areas for 
performance improvement, please let us know by emailing a 
href=#x6d;#97;#105;#x6c;#116;#111;#58;#100;#101;#x76;#x40;#x61;#x70;#x61;#x63;#x68;#101;#46;#x6d;#x65;#115;#x6f;#115;#x2e;#x6f;#x72;#x67;#100;#101;#118;#64;#x61;#x70;#x61;#99;#x68;#x65;#46;#x6d;#x65;#x73;#x6f;#115;#46;#111;#x72;#103;/a./p
 

   

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/b5436993/content/blog/performance-working-group-progress-report/index.html
--
diff --git a/content/blog/performance-working-group-progress-report/index.html 
b/content/blog/performance-working-group-progress-report/index.html
index b02d931..d762774 100644
--- a/content/blog/performance-working-group-progress-report/index.html
+++ b/content/blog/performance-working-group-progress-report/index.html
@@ -248,7 +248,7 @@
 
 
 
-If you are a user and would like to suggest some areas for performance 
improvement, please let us know by emailing .
+If you are a user and would like to suggest some areas for performance 
improvement, please let us know by emailing .
 
   
 

http://git-wip-us.apache.org/repos/asf/mesos-site/blob/b5436993/content/documentation/latest/configuration/agent/index.html
--
diff --git a/content/documentation/latest/configuration/agent/index.html 
b/content/documentation/latest/configuration/agent/index.html
index 1c5d685..699fbaf 100644
--- a/content/documentation/latest/configuration/agent/index.html
+++ b/content/documentation/latest/configuration/agent/index.html
@@ -1082,7 +1082,7 @@ launcher if it's running as root on Linux.
 --launcher_dir=VALUE
   
   
-Directory path of Mesos binaries. Mesos looks for the health-check,
+Directory path of Mesos binaries. Mesos looks for the
 fetcher, containerizer, and executor binary files under this
 directory. (default: /usr/local/libexec/mesos)
   



mesos git commit: Omitted health-check binary in docs for --launcher_dir.

2018-03-02 Thread alexr
Repository: mesos
Updated Branches:
  refs/heads/master 5db8e1d84 -> b0a269691


Omitted health-check binary in docs for --launcher_dir.

This closes #268


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

Branch: refs/heads/master
Commit: b0a26969160ff99452fd209180a4b0ca58da9c1a
Parents: 5db8e1d
Author: Benjamin Peterson 
Authored: Fri Mar 2 12:05:38 2018 +0100
Committer: Alexander Rukletsov 
Committed: Fri Mar 2 12:05:38 2018 +0100

--
 docs/configuration/agent.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/b0a26969/docs/configuration/agent.md
--
diff --git a/docs/configuration/agent.md b/docs/configuration/agent.md
index bf2d7b9..71e5a86 100644
--- a/docs/configuration/agent.md
+++ b/docs/configuration/agent.md
@@ -971,7 +971,7 @@ launcher if it's running as root on Linux.
 --launcher_dir=VALUE
   
   
-Directory path of Mesos binaries. Mesos looks for the health-check,
+Directory path of Mesos binaries. Mesos looks for the
 fetcher, containerizer, and executor binary files under this
 directory. (default: /usr/local/libexec/mesos)