Skip to content
Closed
Changes from all 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 @@ -54,8 +54,12 @@ private[spark] class WorkerWatcher(
if (isTesting) {
isShutDown = true
} else if (isChildProcessStopping.compareAndSet(false, true)) {
// SPARK-35714: avoid the duplicate call of `System.exit` to avoid the dead lock
System.exit(-1)
// SPARK-35714: avoid the duplicate call of `System.exit` to avoid the dead lock.
// Same as SPARK-14180, we should run `System.exit` in a separate thread to avoid
// dead lock since `System.exit` will trigger the shutdown hook of `executor.stop`.
new Thread("WorkerWatcher-exit-executor") {
override def run(): Unit = System.exit(-1)
}.start()
}

override def receive: PartialFunction[Any, Unit] = {
Expand Down