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

bufferPoolsBySize in HeapMemoryAllocator should be thread safe

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.4.3
    • Fix Version/s: None
    • Component/s: Spark Core
    • Labels:
      None

      Description

      Currently, bufferPoolsBySize in HeapMemoryAllocator uses a Map type whose value type is LinkedList.

      LinkedList is not thread safe and may hit the error below

      java.util.NoSuchElementExceptionException
          at java.util.LinkedList.removeFirst(LinkedList.java:270) 
          at java.util.LinkedList.remove(LinkedList.java:685)
          at org.apache.spark.unsafe.memory.HeapMemoryAllocator.allocate(HeapMemoryAllocator.java:57)

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fanyunbojerry Yunbo Fan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: