[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-07-01 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/13962


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-07-01 Thread renozhang
Github user renozhang commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69253594
  
--- Diff: 
yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala ---
@@ -287,19 +330,19 @@ private object YarnClusterDriver extends Logging with 
Matchers {
   sc.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)
   data should be (Set(1, 2, 3, 4))
   result = "success"
+
+  // Verify that the config archive is correctly placed in the 
classpath of all containers.
--- End diff --

Not changing this will cause test broken, because original calling `val 
configFromExecutors = sc.parallelize(1 to 4, 4)` after `sc.stop()` in finally 
will failed with error
```
ApplicationMaster: Final app status: FAILED, exitCode: 15, (reason: User 
class threw exception: java.lang.IllegalStateException: Cannot call methods on 
a stopped SparkContext.
```

After this patch, this problem is exposed. So I put them before `sc.stop`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-07-01 Thread renozhang
Github user renozhang commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69253305
  
--- Diff: 
yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala ---
@@ -330,9 +373,6 @@ private object YarnClusterDriver extends Logging with 
Matchers {
 }
 
 private object YarnClasspathTest extends Logging {
-
-  var exitCode = 0
--- End diff --

Not removing this will break test, because System.exit(0) will cause app 
end with status 'FAILED' (after changed in v2.0 by 
https://github.com/apache/spark/commit/d89c71417c384e1a2820bd80b67c26e11405aebc)
So I should remove this System.exit().



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-06-30 Thread vanzin
Github user vanzin commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69179313
  
--- Diff: 
yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala ---
@@ -330,9 +373,6 @@ private object YarnClusterDriver extends Logging with 
Matchers {
 }
 
 private object YarnClasspathTest extends Logging {
-
-  var exitCode = 0
--- End diff --

Looks like this is really not needed, but in general, try to refrain from 
changing things unrelated to the patch (or call them out explicitly in the PR 
description).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-06-30 Thread vanzin
Github user vanzin commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69178729
  
--- Diff: 
yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala ---
@@ -287,19 +330,19 @@ private object YarnClusterDriver extends Logging with 
Matchers {
   sc.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)
   data should be (Set(1, 2, 3, 4))
   result = "success"
+
+  // Verify that the config archive is correctly placed in the 
classpath of all containers.
--- End diff --

No need to change this. There are other asserts after the `try..catch` 
already. And if you're worried about the result file, that's legacy stuff that 
I'm pretty sure we can remove, although in a separate change.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-06-30 Thread vanzin
Github user vanzin commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69178533
  
--- Diff: 
yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala ---
@@ -259,6 +265,43 @@ private[spark] class SaveExecutorInfo extends 
SparkListener {
   }
 }
 
+private object YarnClusterDriverWithFailure extends Logging with Matchers {
+
+  val WAIT_TIMEOUT_MILLIS = 1
+
+  def main(args: Array[String]): Unit = {
+if (args.length != 1) {
+  // scalastyle:off println
+  System.err.println(
+s"""
+|Invalid command line: ${args.mkString(" ")}
+|
+|Usage: YarnClusterDriver [result file]
+""".stripMargin)
+  // scalastyle:on println
+  System.exit(1)
+}
+
+val sc = new SparkContext(new SparkConf()
+  .set("spark.extraListeners", classOf[SaveExecutorInfo].getName)
+  .setAppName("yarn \"test app\" 'with quotes' and \\back\\slashes and 
$dollarSigns"))
+val conf = sc.getConf
+val status = new File(args(0))
+var result = "failure"
+try {
+  val data = sc.parallelize(1 to 4, 4).collect().toSet
--- End diff --

Do you need to do any of this? Why not just throw an exception at this 
point? You also don't need to bother with code to write the result file, since 
you want the app to fail anyway.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-06-30 Thread vanzin
Github user vanzin commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69178301
  
--- Diff: 
yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnClusterSuite.scala ---
@@ -120,6 +120,12 @@ class YarnClusterSuite extends BaseYarnClusterSuite {
 finalState should be (SparkAppHandle.State.FAILED)
   }
 
+  test("run Spark in yarn-cluster mode falure after sc initialized") {
--- End diff --

typo: "failure"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #13962: [SPARK-16095][YARN] Yarn cluster mode should repo...

2016-06-30 Thread vanzin
Github user vanzin commented on a diff in the pull request:

https://github.com/apache/spark/pull/13962#discussion_r69178203
  
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala ---
@@ -1053,7 +1053,12 @@ private[spark] class Client(
   case YarnApplicationState.RUNNING =>
 reportLauncherState(SparkAppHandle.State.RUNNING)
   case YarnApplicationState.FINISHED =>
-reportLauncherState(SparkAppHandle.State.FINISHED)
+report.getFinalApplicationStatus match {
+  case FinalApplicationStatus.FAILED =>
--- End diff --

How about also handling `KILLED`? In case the app is killed via YARN UI / 
CLI.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org