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

FileFormatWriter.ExecuteWriteTask.releaseResources() implementations to be re-entrant

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.2.0
    • 2.2.0
    • Spark Core
    • None

    Description

      Both FileFormatWriter.ExecuteWriteTask.releaseResources() implementations close() any non-null currentWriter, then set the field to null

      However, if the close() call throws an exception in the execution of {FileFormatWriter.executeTask, the exception handler will attempt to cleanup, by calling releaseResources() again. Looking at the codepath, this may cause committer.abortTask() to get skipped on failure.

      This surfaces in SPARK-10109 and I've just seen it in HADOOP-14204); Parquet seems to be in the trace as it NPEs the second time it's close() method is called.

      Fix: always set currentWriter to null,

      Attachments

        Issue Links

          Activity

            People

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: