Skip to content

Commit

Permalink
fix bug when killTask may kill main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
casionone committed Dec 13, 2023
1 parent 7599b05 commit f12436c
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,14 @@ abstract class SparkEngineConnExecutor(val sc: SparkContext, id: Long)
logger.info(s"thread isInterrupted:${thread.isInterrupted}")

if (closeThreadEnable) {
logger.info(s"try to force stop thread:${thread.getName}")
// force to stop scala thread
Utils.tryAndWarn(thread.stop())
val threadName = thread.getName
if (threadName.contains("Linkis-Default-Scheduler-Thread-")) {
logger.info(s"try to force stop thread:${threadName}")
// force to stop scala thread
Utils.tryAndWarn(thread.stop())
} else {
logger.info(s"skip to force stop thread:${threadName}")
}
}
}
killRunningTask()
Expand Down

0 comments on commit f12436c

Please sign in to comment.