Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ private[spark] class UninterruptibleThread(
* is true) and no concurrent [[interrupt()]] call, otherwise false
*/
def isInterruptible: Boolean = synchronized {
shouldInterruptThread = uninterruptible
// SPARK-53394: We should not interrupt the thread when it is already interrupted.
// Otherwise, the state of `shouldInterruptThread` becomes inconsistent between
// `isInterruptible()` and `isInterruptPending()`, leading to `UninterruptibleThread`
// be interruptible under `runUninterruptibly`.
shouldInterruptThread = uninterruptible || UninterruptibleThread.this.isInterrupted
// as we are releasing uninterruptibleLock before calling super.interrupt() there is a
// possibility that runUninterruptibly() would be called after lock is released but before
// super.interrupt() is called. In this case to prevent runUninterruptibly() from being
Expand Down