Improve the warning when failing to find the executor PID.

When recovering the run state, if we don't find either the libprocess
PID or the HTTP marker for the executor, that fact was being logged,
but there was nothing to identify the executor or container. Add the
framework, executor and container IDs to the message, and clarify that
we can't find either marker.

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


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

Branch: refs/heads/master
Commit: 00d4fa0b102f18684b3cf787c46cd260bcfe403a
Parents: 63b6628
Author: James Peach <[email protected]>
Authored: Thu Mar 23 08:11:15 2017 -0700
Committer: Anand Mazumdar <[email protected]>
Committed: Thu Mar 23 08:11:15 2017 -0700

----------------------------------------------------------------------
 src/slave/paths.hpp |  4 ++++
 src/slave/state.cpp | 16 ++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/00d4fa0b/src/slave/paths.hpp
----------------------------------------------------------------------
diff --git a/src/slave/paths.hpp b/src/slave/paths.hpp
index e64e896..51b481f 100644
--- a/src/slave/paths.hpp
+++ b/src/slave/paths.hpp
@@ -309,6 +309,10 @@ std::string createSlaveDirectory(
     const std::string& rootDir,
     const SlaveID& slaveId);
 
+
+extern const char LIBPROCESS_PID_FILE[];
+extern const char HTTP_MARKER_FILE[];
+
 } // namespace paths {
 } // namespace slave {
 } // namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/00d4fa0b/src/slave/state.cpp
----------------------------------------------------------------------
diff --git a/src/slave/state.cpp b/src/slave/state.cpp
index f8e7cdd..33dcc7a 100644
--- a/src/slave/state.cpp
+++ b/src/slave/state.cpp
@@ -502,8 +502,9 @@ Try<RunState> RunState::recover(
 
   Try<pid_t> forkedPid = numify<pid_t>(pid.get());
   if (forkedPid.isError()) {
-    return Error("Failed to parse forked pid " + pid.get() +
-                 ": " + forkedPid.error());
+    return Error("Failed to parse forked pid '" + pid.get() + "' "
+                 "from pid file '" + path + "': " +
+                 forkedPid.error());
   }
 
   state.forkedPid = forkedPid.get();
@@ -545,15 +546,18 @@ Try<RunState> RunState::recover(
   path = paths::getExecutorHttpMarkerPath(
       rootDir, slaveId, frameworkId, executorId, containerId);
 
+  // The marker could be absent if the slave died before the executor
+  // registered with the slave.
   if (!os::exists(path)) {
-    // This could happen if the slave died before the executor
-    // registered with the slave.
-    LOG(WARNING) << "Failed to find executor libprocess pid/http marker file";
+    LOG(WARNING) << "Failed to find '" <<  paths::LIBPROCESS_PID_FILE
+                 << "' or '" << paths::HTTP_MARKER_FILE
+                 << "' for container " << containerId
+                 << " of executor '" << executorId
+                 << "' of framework " << frameworkId;
     return state;
   }
 
   state.http = true;
-
   return state;
 }
 

Reply via email to