HeartSaVioR commented on a change in pull request #25808:
[SPARK-29104][CORE][TESTS] Fix PipedRDDSuite to use `eventually` to check
thread termination
URL: https://github.com/apache/spark/pull/25808#discussion_r324999132
##########
File path: core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala
##########
@@ -100,11 +102,16 @@ class PipedRDDSuite extends SparkFunSuite with
SharedSparkContext {
assert(result.collect().length === 0)
- // collect stderr writer threads
- val stderrWriterThread = Thread.getAllStackTraces.keySet().asScala
- .find { _.getName.startsWith(PipedRDD.STDIN_WRITER_THREAD_PREFIX) }
-
- assert(stderrWriterThread.isEmpty)
+ // SPARK-29104 PipedRDD will invoke `stdinWriterThread.interrupt()` at
task completion,
+ // and `obj.wait` will get InterruptedException. However, there exists a
possibility
Review comment:
Thanks for the updated patch. Much better with artificially reproducing the
issue.
I'm trying to understand the situation - for the sake of understanding,
interrupting thread would throw InterruptedException when thread is waiting via
`obj.wait()` and stdinWriterThread will catch it, and run() will finish.
I'm trying to understand the problematic situation as well - if
Thread.interrupt() occurs before obj.wait(), the thread will keep running until
there's some method understanding Thread's interrupted state (like
Object.wait() which will throw InterruptedException even it was thrown earlier)
so there's possible delay for thread to be finished. Could you confirm my
understanding?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]