Skip to content

Commit ef78e72

Browse files
refactor: Remove shutdown watchdog method and related test from SparkSQLEngine and ThreadDumpUtils
- Deleted the `stopShutdownWatchdog` method from SparkSQLEngine to simplify the shutdown process. - Removed the test for `installShutdownHook` in ThreadDumpUtils, streamlining the test suite by eliminating outdated tests.
1 parent 534d8e9 commit ef78e72

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -289,21 +289,6 @@ case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngin
289289
debug(s"Shutdown Watchdog thread started: ${watchdogThread.getName}")
290290
}
291291

292-
/**
293-
* Stops the shutdown watchdog thread during normal shutdown process.
294-
*/
295-
private def stopShutdownWatchdog(): Unit = {
296-
Option(watchdogThreadRef.getAndSet(null)) match {
297-
case Some(thread) if thread.isAlive =>
298-
debug("Stopping Shutdown Watchdog")
299-
thread.interrupt()
300-
info("Shutdown Watchdog stopped - normal shutdown in progress")
301-
302-
case _ =>
303-
debug("Shutdown Watchdog was not running")
304-
}
305-
}
306-
307292
}
308293

309294
object SparkSQLEngine extends Logging {

kyuubi-common/src/test/scala/org/apache/kyuubi/util/ThreadDumpUtilsSuite.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@ class ThreadDumpUtilsSuite extends KyuubiFunSuite {
5252
assert(output.contains("Thread Dump End"))
5353
}
5454

55-
test("installShutdownHook should not throw") {
56-
try {
57-
ThreadDumpUtils.installShutdownHook()
58-
assert(true)
59-
} catch {
60-
case e: Throwable =>
61-
fail(s"installShutdownHook should not throw, but got: $e")
62-
}
63-
}
64-
6555
test("dumpToString should respect showDaemonThreads config") {
6656
val config = ThreadDumpUtils.DumpConfig(showDaemonThreads = false)
6757
val dump = ThreadDumpUtils.dumpToString(config)

0 commit comments

Comments
 (0)