Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31456

If shutdownhook is added with priority Integer.MIN_VALUE, it's supposed to be called the last, but it gets called before other positive priority shutdownhook

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.3, 2.0.2, 2.1.3, 2.2.3, 2.3.4, 2.4.5
    • 2.4.6, 3.0.0
    • Spark Core
    • None
    • macOS Mojave 10.14.6

    Description

      https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/util/ShutdownHookManager.scala

      Since shutdownHookManager use below method to do the comparison.
      override def compareTo(other: SparkShutdownHook): Int =

      { other.priority - priority }

      Which will cause :
      (Int)(25 - Integer.MIN_VALUE) < 0
      Then the shutdownhook with Integer.Min_VALUE would not be called the last.

      Attachments

        Activity

          People

            olkuznsmith Oleg Kuznetsov
            nancysilence Xiaolei Liu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: