Skip to content

Commit ee6f1aa

Browse files
committed
Added constant "SHUTDOWN_HOOK_PRIORITY" to ApplicationMaster
1 parent 54eb68f commit ee6f1aa

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
105105
}
106106

107107
// Use higher priority than FileSystem.
108-
val priority = 20
109-
assert(priority > FileSystem.SHUTDOWN_HOOK_PRIORITY)
110-
ShutdownHookManager.get().addShutdownHook(cleanupHook, 20)
108+
assert(ApplicationMaster.SHUTDOWN_HOOK_PRIORITY > FileSystem.SHUTDOWN_HOOK_PRIORITY)
109+
ShutdownHookManager.get().addShutdownHook(cleanupHook, ApplicationMaster.SHUTDOWN_HOOK_PRIORITY)
111110

112111
// Call this to force generation of secret so it gets populated into the
113112
// Hadoop UGI. This has to happen before the startUserClass which does a
@@ -408,6 +407,8 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
408407

409408
object ApplicationMaster extends Logging {
410409

410+
private val SHUTDOWN_HOOK_PRIORITY: Int = 30
411+
411412
private var master: ApplicationMaster = _
412413

413414
def main(args: Array[String]) = {

0 commit comments

Comments
 (0)