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/11/04 02:30:49 UTC

svn commit: r1405480 - /incubator/mesos/branches/0.10.0/src/launcher/launcher.cpp

Author: benh
Date: Sun Nov  4 01:30:48 2012
New Revision: 1405480

URL: http://svn.apache.org/viewvc?rev=1405480&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/branches/0.10.0/src/launcher/launcher.cpp

Modified: incubator/mesos/branches/0.10.0/src/launcher/launcher.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/branches/0.10.0/src/launcher/launcher.cpp?rev=1405480&r1=1405479&r2=1405480&view=diff
==============================================================================
--- incubator/mesos/branches/0.10.0/src/launcher/launcher.cpp (original)
+++ incubator/mesos/branches/0.10.0/src/launcher/launcher.cpp Sun Nov  4 01:30:48 2012
@@ -314,6 +314,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,
@@ -327,9 +332,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");
 }