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



##########
File path: mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala
##########
@@ -183,7 +190,16 @@ class CrossValidator @Since("1.2.0") (@Since("1.4.0") 
override val uid: String)
       }
 
       // Wait for metrics to be calculated
-      val foldMetrics = foldMetricFutures.map(ThreadUtils.awaitResult(_, 
Duration.Inf))
+      val foldMetrics = try {
+        foldMetricFutures.map(ThreadUtils.awaitResult(_, Duration.Inf))
+      } finally {
+        subTaskFailed = true
+        Thread.sleep(1000)
+        val sparkContext = sparkSession.sparkContext
+        sparkContext.cancelJobGroup(

Review comment:
       Should we only cancel on failure?




-- 
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