You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/12/08 00:02:07 UTC

mesos git commit: Added logging for I/O switchboard.

Repository: mesos
Updated Branches:
  refs/heads/master 8dcef9c62 -> d857f47e7


Added logging for I/O switchboard.

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


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

Branch: refs/heads/master
Commit: d857f47e79534aff403b6e626519e3b291ff1439
Parents: 8dcef9c
Author: Jie Yu <yu...@gmail.com>
Authored: Wed Dec 7 15:34:46 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Dec 7 16:02:00 2016 -0800

----------------------------------------------------------------------
 .../containerizer/mesos/io/switchboard.cpp      | 21 ++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d857f47e/src/slave/containerizer/mesos/io/switchboard.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index 226bab8..af95695 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -560,6 +560,9 @@ Future<Option<ContainerLaunchInfo>> IOSwitchboard::_prepare(
   // TODO(jieyu): Consider making this configurable.
   environment.emplace("LIBPROCESS_NUM_WORKER_THREADS", "8");
 
+  VLOG(1) << "Launching '" << IOSwitchboardServer::NAME << "' with flags '"
+          << switchboardFlags << "' for container " << containerId;
+
   // Launch the io switchboard server process.
   // We `dup()` the `stdout` and `stderr` passed to us by the
   // container logger over the `stdout` and `stderr` of the io
@@ -587,6 +590,10 @@ Future<Option<ContainerLaunchInfo>> IOSwitchboard::_prepare(
                    " server process: " + child.error());
   }
 
+  LOG(INFO) << "Created I/O switchboard server (pid: " << child->pid()
+            << ") listening on socket file '" << switchboardFlags.socket_path
+            << "' for container " << containerId;
+
   close(ioSwitchboardFds);
 
   // We remove the already closed file descriptors from 'openedFds' so
@@ -642,7 +649,7 @@ Future<http::Connection> IOSwitchboard::connect(
   }
 
   if (!infos.contains(containerId)) {
-    return Failure("IO switchboard server was disabled for this container");
+    return Failure("I/O switchboard server was disabled for this container");
   }
 
   // Get the io switchboard address from the `containerId`.
@@ -708,7 +715,7 @@ Future<ContainerLimitation> IOSwitchboard::watch(
   Future<Option<int>> status = infos[containerId]->status;
 
   return status
-    .then([](const Option<int>& status) {
+    .then([containerId](const Option<int>& status) {
       if (status.isNone()) {
         return Future<ContainerLimitation>();
       }
@@ -732,6 +739,9 @@ Future<ContainerLimitation> IOSwitchboard::watch(
             " " + stringify(strsignal(WTERMSIG(status.get()))));
       }
 
+      LOG(ERROR) << "Unexpected termination of I/O switchboard server: "
+                 << limitation.message() << " for container " << containerId;
+
       return Future<ContainerLimitation>(limitation);
     });
 #endif // __WINDOWS__
@@ -777,11 +787,18 @@ Future<Nothing> IOSwitchboard::cleanup(
   // TODO(klueska): Send a message over the io switchboard server's
   // domain socket instead of using a signal.
   if (pid.isSome()) {
+    LOG(INFO) << "Sending SIGTERM to I/O switchboard server (pid: "
+              << pid.get() << ") since container " << containerId
+              << " is being destroyed";
+
     os::kill(pid.get(), SIGTERM);
   }
 
   return status
     .then(defer(self(), [this, containerId]() {
+      LOG(INFO) << "I/O switchboard server process for container "
+                << containerId << " has terminated";
+
       // Best effort removal of the unix domain socket file created for
       // this container's `IOSwitchboardServer`. If it hasn't been
       // checkpointed yet, or the socket file itself hasn't been created,