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

Race condition in FsHistoryProvider

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.2.0
    • None
    • Spark Core

    Description

      There exist a race condition in checkLogs method between threads of replayExecutor. They use the field "applications" to synchronise, but they also update that field.

      The problem is that threads will eventually synchronise on different monitors (because they will synchronise on different objects which references have been assigned to "applications"), breaking the initial synchronisation intent. This has even greater chance to reproduce when number_new_log_files > replayExecutor_pool_size

      If such log disappears (it will not be present in the list "applications"), it will be impossible to read it from the UI (being in the list "applications" is a mandatory check to avoid getting a 404)

      Workaround:

      • use a permanent object as a monitor on which to synchronise (or synchronise on `this`)
      • keep volatile field for all other read accesses

      Attachments

        Activity

          People

            Unassigned Unassigned
            willymontaz William Montaz
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: