You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/10/13 02:55:00 UTC

svn commit: r1397749 - /incubator/mesos/trunk/src/launcher/launcher.cpp

Author: benh
Date: Sat Oct 13 00:54:59 2012
New Revision: 1397749

URL: http://svn.apache.org/viewvc?rev=1397749&view=rev
Log:
"Unset" LIBPROCESS_PORT before applying executor/command environment
variables (in the event they modify it).

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

Modified:
    incubator/mesos/trunk/src/launcher/launcher.cpp

Modified: incubator/mesos/trunk/src/launcher/launcher.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/launcher/launcher.cpp?rev=1397749&r1=1397748&r2=1397749&view=diff
==============================================================================
--- incubator/mesos/trunk/src/launcher/launcher.cpp (original)
+++ incubator/mesos/trunk/src/launcher/launcher.cpp Sat Oct 13 00:54:59 2012
@@ -330,6 +330,11 @@ int ExecutorLauncher::fetchExecutors()
 // Set up environment variables for launching a framework's executor.
 void ExecutorLauncher::setupEnvironment()
 {
+  // Set LIBPROCESS_PORT so that we bind to a random free port (since
+  // this might have been set via --port option). We do this before
+  // the environment variables below in case it is included.
+  os::setenv("LIBPROCESS_PORT", "0");
+
   // Set up the environment as specified in the ExecutorInfo.
   if (commandInfo.has_environment()) {
     foreach (const Environment::Variable& variable,
@@ -343,9 +348,6 @@ void ExecutorLauncher::setupEnvironment(
   os::setenv("MESOS_SLAVE_PID", slavePid);
   os::setenv("MESOS_FRAMEWORK_ID", frameworkId.value());
   os::setenv("MESOS_EXECUTOR_ID", executorId.value());
-
-  // Set LIBPROCESS_PORT so that we bind to a random free port.
-  os::setenv("LIBPROCESS_PORT", "0");
 }