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

Call to MetricsSystem#getServletHandlers() may take place before MetricsSystem becomes running

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.1.2
    • None
    • Spark Core
    • None

    Description

      Sometimes the following exception is observed:

      java.lang.IllegalArgumentException: requirement failed: Can only call getServletHandlers on a running MetricsSystem
          at scala.Predef$.require(Predef.scala:281)
          at org.apache.spark.metrics.MetricsSystem.getServletHandlers(MetricsSystem.scala:92)
          at org.apache.spark.SparkContext.<init>(SparkContext.scala:597)
          at org.apache.spark.api.java.JavaSparkContext.<init>(JavaSparkContext.scala:58)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      

      It seems somehow the MetricsSystem was stopped in between start() and getServletHandlers() calls.
      SparkContext should check the MetricsSystem becomes running before calling getServletHandlers()

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuzhihong@gmail.com Ted Yu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: