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

Daniel Barclay (Drill/MapR) commented on DRILL-1909:
----------------------------------------------------

Right--the fix is either making increment() synchronized, or specifying clearly 
that methods increment() and waitForSendComplete() must not be called 
concurrently (and that calling them from the same thread (the intended use) is 
fine).

I have a change in progress.  It currently adds "synchronized", but already 
includes an explanatory comment whose text could be edited into the alternative 
solution of just documenting the restriction.  (It also adds various 
documentation comments and makes internal names clearer.)

Is there any need to not synchronize increment()?  There wouldn't be any 
contention in our intended use (both called only from one thread), right?  How 
much do uncontended locks affect performance?  

Daniel






> Fix SendingAccountor thread safety
> ----------------------------------
>
>                 Key: DRILL-1909
>                 URL: https://issues.apache.org/jira/browse/DRILL-1909
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>            Reporter: Daniel Barclay (Drill/MapR)
>            Assignee: Daniel Barclay (Drill/MapR)
>
> SendingAccountor's increment() method is not synchronized, but both it and 
> (already synchronized) method waitForSendComplete() both modify the same 
> variable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to