Skip to content

Commit

Permalink
Update Worker.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Jul 25, 2023
1 parent 9139603 commit 4d0d80b
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ private[celeborn] class Worker(
logInfo("Worker is stopped.")
stopped = true
}
shutdown.set(true)
}

private def registerWithMaster(): Unit = {
Expand Down Expand Up @@ -623,11 +622,15 @@ private[celeborn] class Worker(
ShutdownHookManager.get().addShutdownHook(
new Thread(new Runnable {
override def run(): Unit = {
logInfo("Shutdown hook called.")
if (exitKind == CelebornExitKind.WORKER_GRACEFUL_SHUTDOWN) {
shutdownGracefully()
if (stopped) {
logInfo("Worker already stopped before call ShutdownHook.")
} else {
exitImmediately()
logInfo("Shutdown hook called.")
if (exitKind == CelebornExitKind.WORKER_GRACEFUL_SHUTDOWN) {
shutdownGracefully()
} else {
exitImmediately()
}
}
}
}),
Expand Down

0 comments on commit 4d0d80b

Please sign in to comment.