advancedxy commented on a change in pull request #23638: [SPARK-26713][CORE]
Release pipe IO threads in PipedRDD when task is finished
URL: https://github.com/apache/spark/pull/23638#discussion_r250658745
##########
File path: core/src/main/scala/org/apache/spark/rdd/PipedRDD.scala
##########
@@ -156,7 +157,34 @@ private[spark] class PipedRDD[T: ClassTag](
out.close()
}
}
- }.start()
+ }
+ stdinWriterThread.start()
+
+ def cleanUpIOThreads(): Unit = {
+ if (proc.isAlive) {
+ proc.destroy()
+ }
+ if (stdinWriterThread.isAlive) {
+ stdinWriterThread.stop()
Review comment:
Yes, I'm aware `Thread.stop` is deprecated and 'dangerous' . I didn't think
it's sufficient to just interrupt threads and should be safe enough to stop
these IO threads.
After a second thought, interrupt should be enough. Will update the code
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]