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

"this" reference escape to "selectorThread" during construction in ConnectionManager

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: Spark Core
    • Labels:
      None

      Description

      `selectorThread` starts in the construction of `org.apache.spark.network.ConnectionManager`, which may cause `writeRunnableStarted` and `readRunnableStarted` are uninitialized before them are used.

      Indirectly, `BlockManager.this` also escape since it calls `new ConnectionManager(...)` and will be used in some threads of `ConnectionManager`. Some threads may view an uninitialized `BlockManager`.

      In summary, it's dangerous and hard to analyse the correctness of concurrency. Such escape should be avoided.

        Attachments

          Activity

            People

            • Assignee:
              srowen Sean R. Owen
              Reporter:
              zsxwing Shixiong Zhu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: