drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-6125) PartitionSenderRootExec can leak memory because close method is not synchronized
Date Sat, 10 Feb 2018 01:05:00 GMT

    [ https://issues.apache.org/jira/browse/DRILL-6125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16359167#comment-16359167

ASF GitHub Bot commented on DRILL-6125:

Github user ilooner commented on the issue:

    @sachouche I traced through the code. The updateAggregateStats method is called, which
then calls the getOutgoingBatches method of the code generated Partitioners. That method is
just a simple getter. So no one is acquiring the same lock. But even if someone else was,
the code in the close method is single threaded, and synchronize blocks are reentrant. 

> 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
>    Affects Versions: 1.13.0
>            Reporter: Timothy Farkas
>            Assignee: Timothy Farkas
>            Priority: Minor
>             Fix For: 1.13.0
> 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

View raw message