[ https://issues.apache.org/jira/browse/DRILL-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16347393#comment-16347393 ]
ASF GitHub Bot commented on DRILL-6125: --------------------------------------- GitHub user ilooner opened a pull request: https://github.com/apache/drill/pull/1105 DRILL-6125: Fix possible memory leak when query is cancelled. A detailed description of the problem and solution can be found here: https://issues.apache.org/jira/browse/DRILL-6125 You can merge this pull request into a Git repository by running: $ git pull https://github.com/ilooner/drill DRILL-6125 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/drill/pull/1105.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1105 ---- commit 1d1725a276c058e8c09e456963bac928d1f062ed Author: Timothy Farkas <timothyfarkas@...> Date: 2018-01-30T23:55:41Z DRILL-6125: Fix possible memory leak when query is cancelled. ---- > PartitionSenderRootExec can leak memory because close method is not > synchronized > -------------------------------------------------------------------------------- > > Key: DRILL-6125 > URL: https://issues.apache.org/jira/browse/DRILL-6125 > Project: Apache Drill > Issue Type: Bug > Reporter: Timothy Farkas > Assignee: Timothy Farkas > Priority: Major > > 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. -- This message was sent by Atlassian JIRA (v7.6.3#76005)