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

Remove unsafe asynchronous close() call from FileDownloadChannel

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.6.0, 2.0.0, 2.1.0, 2.2.0
    • 2.2.2, 2.3.0
    • Spark Core

    Description

      Spark's Netty-based file transfer code contains an asynchronous IO bug which may lead to incorrect query results.

      At a high-level, the problem is that an unsafe asynchronous `close()` of a pipe's source channel creates a race condition where file transfer code closes a file descriptor then attempts to read from it. If the closed file descriptor's number has been reused by an `open()` call then this invalid read may cause unrelated file operations to return incorrect results due to reading different data than intended.

      I have a small, surgical fix for this bug and will submit a PR with more description on the specific race condition / underlying bug.

      Attachments

        Activity

          People

            joshrosen Josh Rosen
            joshrosen Josh Rosen
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: