Skip to content
Snippets Groups Projects
Commit 3d4ad84b authored by Reynold Xin's avatar Reynold Xin
Browse files

Merge pull request #148 from squito/include_appId

Include appId in executor cmd line args

add the appId back into the executor cmd line args.

I also made a pretty lame regression test, just to make sure it doesn't get dropped in the future.  not sure it will run on the build server, though, b/c `ExecutorRunner.buildCommandSeq()` expects to be abel to run the scripts in `bin`.
parents be7e8da9 ca66f5d5
No related branches found
No related tags found
No related merge requests found
...@@ -104,7 +104,7 @@ private[spark] class ExecutorRunner( ...@@ -104,7 +104,7 @@ private[spark] class ExecutorRunner(
// SPARK-698: do not call the run.cmd script, as process.destroy() // SPARK-698: do not call the run.cmd script, as process.destroy()
// fails to kill a process tree on Windows // fails to kill a process tree on Windows
Seq(runner) ++ buildJavaOpts() ++ Seq(command.mainClass) ++ Seq(runner) ++ buildJavaOpts() ++ Seq(command.mainClass) ++
command.arguments.map(substituteVariables) (command.arguments ++ Seq(appId)).map(substituteVariables)
} }
/** /**
......
...@@ -111,7 +111,7 @@ private[spark] object CoarseGrainedExecutorBackend { ...@@ -111,7 +111,7 @@ private[spark] object CoarseGrainedExecutorBackend {
def main(args: Array[String]) { def main(args: Array[String]) {
if (args.length < 4) { if (args.length < 4) {
//the reason we allow the last frameworkId argument is to make it easy to kill rogue executors //the reason we allow the last appid argument is to make it easy to kill rogue executors
System.err.println( System.err.println(
"Usage: CoarseGrainedExecutorBackend <driverUrl> <executorId> <hostname> <cores> " + "Usage: CoarseGrainedExecutorBackend <driverUrl> <executorId> <hostname> <cores> " +
"[<appid>]") "[<appid>]")
......
package org.apache.spark.deploy.worker
import java.io.File
import org.scalatest.FunSuite
import org.apache.spark.deploy.{ExecutorState, Command, ApplicationDescription}
class ExecutorRunnerTest extends FunSuite {
test("command includes appId") {
def f(s:String) = new File(s)
val sparkHome = sys.props("user.dir")
val appDesc = new ApplicationDescription("app name", 8, 500, Command("foo", Seq(),Map()),
sparkHome, "appUiUrl")
val appId = "12345-worker321-9876"
val er = new ExecutorRunner(appId, 1, appDesc, 8, 500, null, "blah", "worker321", f(sparkHome),
f("ooga"), ExecutorState.RUNNING)
assert(er.buildCommandSeq().last === appId)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment