You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "Ngone51 (via GitHub)" <gi...@apache.org> on 2024/06/05 07:19:53 UTC
Re: [PR] [SPARK-46947][CORE] Delay memory manager initialization until Driver plugin is loaded [spark]
Ngone51 commented on code in PR #45052:
URL: https://github.com/apache/spark/pull/45052#discussion_r1627131106
##########
core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala:
##########
@@ -680,14 +683,80 @@ class TaskContextSuite extends SparkFunSuite with BeforeAndAfter with LocalSpark
context.markTaskCompleted(None)
assert(isFailed)
}
+
+ test("SPARK-46947: ensure the correct block manager is used to unroll memory for task") {
+ import BlockManagerValidationPlugin._
+ BlockManagerValidationPlugin.resetState()
+
+ // run a task which ignores thread interruption when spark context is shutdown
+ sc = new SparkContext("local", "test")
+
+ val rdd = new RDD[String](sc, List()) {
+ override def getPartitions = Array[Partition](StubPartition(0))
+
+ override def compute(split: Partition, context: TaskContext): Iterator[String] = {
+ context.addTaskCompletionListener(new TaskCompletionListener {
+ override def onTaskCompletion(context: TaskContext): Unit = {
+ try {
+ releaseTaskSem.acquire()
+ } catch {
+ case _: InterruptedException =>
+ // ignore thread interruption
Review Comment:
@sunchao What's the purpose to leave a running task from the old `SparkContext`?
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org