vrozov commented on code in PR #50594:
URL: https://github.com/apache/spark/pull/50594#discussion_r2054245540


##########
core/src/test/scala/org/apache/spark/util/UninterruptibleThreadSuite.scala:
##########
@@ -115,6 +116,51 @@ class UninterruptibleThreadSuite extends SparkFunSuite {
     assert(interruptStatusBeforeExit)
   }
 
+  test("no runUninterruptibly") {
+    @volatile var hasInterruptedException = false
+    val t = new UninterruptibleThread("test") {
+      override def run(): Unit = {
+        if (sleep(0)) {
+          hasInterruptedException = true
+        }
+      }
+    }
+    t.interrupt()
+    t.start()
+    t.join()
+    assert(hasInterruptedException === true)
+  }
+
+  private class InterruptibleChannel(latch: CountDownLatch, lock: Object, 
thread: Thread)
+    extends AbstractInterruptibleChannel {
+    begin()
+    latch.countDown()
+    close()
+    override def implCloseChannel(): Unit = {
+      try {
+        Thread.sleep(Long.MaxValue)
+      } catch {
+        case _: InterruptedException => thread.interrupt()
+      }
+    }
+  }
+
+  test("uninterruptibleLock deadlock") {
+    val lock = new Object
+    val latch = new CountDownLatch(1)
+    val task = new UninterruptibleThread("task thread") {
+      override def run(): Unit = {
+        new InterruptibleChannel(latch, lock, Thread.currentThread())

Review Comment:
   @cloud-fan It is exactly the same deadlock as what is reported during 
Parquet upgrade. Please see 
https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java#L1029



-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to