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

bufferPoolsBySize in HeapMemoryAllocator should be thread safe

Rank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 2.4.3
    • None
    • Spark Core
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            fanyunbojerry fanartoria
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment