Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6125

PartitionSenderRootExec can leak memory because close method is not synchronized

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.13.0
    • 1.14.0
    • None

    Description

      PartitionSenderRootExec creates a PartitionerDecorator and saves it in the partitioner field. The creation of the partitioner happens in the createPartitioner method. This method get's called by the main fragment thread. The partitioner field is accessed by the fragment thread during normal execution but it can also be accessed by the receivingFragmentFinished method which is a callback executed by the event processor thread. Because multiple threads can access the partitioner field synchronization is done on creation and on when receivingFragmentFinished. However, the close method can also be called by the event processor thread, and the close method does not synchronize before accessing the partitioner field. Since synchronization is not done the event processor thread may have an old reference to the partitioner when a query cancellation is done. Since it has an old reference the current partitioner can may not be cleared and a memory leak may occur.

      Attachments

        Issue Links

        Activity

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

          People

            timothyfarkas Timothy Farkas
            timothyfarkas Timothy Farkas
            Vlad Rozov Vlad Rozov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment