Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/20449#discussion_r170501590 --- Diff: core/src/test/scala/org/apache/spark/JobCancellationSuite.scala --- @@ -320,6 +319,55 @@ class JobCancellationSuite extends SparkFunSuite with Matchers with BeforeAndAft f2.get() } + test("Interruptible iterator of shuffle reader") { + import JobCancellationSuite._ + val numSlice = 2 + sc = new SparkContext(s"local[$numSlice]", "test") + + val f = sc.parallelize(1 to 1000, numSlice).map { i => (i, i) } + .repartitionAndSortWithinPartitions(new HashPartitioner(2)) + .mapPartitions { iter => + taskStartedSemaphore.release() + iter + }.foreachAsync { x => + if ( x._1 >= 10) { // this block of code is partially executed. --- End diff -- no space after `if(`
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org