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

QueryExecutionListener never cleans up listeners from the bus after SparkSession is cleared

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • SQL
    • None

    Description

      As a result of https://github.com/apache/spark/commit/9690eba16efe6d25261934d8b73a221972b684f3, it looks like there is a memory leak (specifically https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala#L131). 

      Because the Listener Bus on the context still has a reference to the listener (even after the SparkSession is cleared), they are never cleaned up. This means that if you close and remake spark sessions fairly frequently, you're leaking every single time. 

       

      Attachments

        1. Screenshot 2022-01-16 at 23.16.10.png
          1.66 MB
          Stanislav Savulchik
        2. image001-1.png
          888 kB
          Vinoo Ganesh

        Activity

          People

            Unassigned Unassigned
            vinooganesh Vinoo Ganesh
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: