WeichenXu123 commented on a change in pull request #32399:
URL: https://github.com/apache/spark/pull/32399#discussion_r633178439



##########
File path: mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala
##########
@@ -168,9 +169,19 @@ class CrossValidator @Since("1.2.0") (@Since("1.4.0") 
override val uid: String)
       val validationDataset = sparkSession.createDataFrame(validation, 
schemaWithoutFold).cache()
       instr.logDebug(s"Train split $splitIndex with multiple sets of 
parameters.")
 
+      val sparkContext = sparkSession.sparkContext
+      val oldJobGroup = 
sparkContext.getLocalProperty(SparkContext.SPARK_JOB_GROUP_ID)
+      val cvJobGroup = s"${this.uid}_job_group"
+      sparkContext.setLocalProperty(SparkContext.SPARK_JOB_GROUP_ID, 
cvJobGroup)
+      @volatile var subTaskFailed = false
       // Fit models in a Future for training in parallel
       val foldMetricFutures = epm.zipWithIndex.map { case (paramMap, 
paramIndex) =>
         Future[Double] {
+          if (subTaskFailed) {
+            throw new RuntimeException(

Review comment:
       Yes just for kill the future thread.
   I already add message in the runtimeException. So I think it is fine.
   `IllegalStateException` means "Signals that a method has been invoked at an 
illegal or inappropriate time" so it may be not a proper exception class name.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to