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

ASF GitHub Bot commented on KAFKA-2311:
---------------------------------------

GitHub user tbrooks8 opened a pull request:

    https://github.com/apache/kafka/pull/1637

    KAFKA-2311: Consumer's ensureNotClosed method not thread safe

    Here is the patch on github @ijuma.
    
    Acquiring the consumer lock (the single thread access controls) requires 
that the consumer be open. I changed the closed variable to be volatile so that 
another thread's writes will visible to the reading thread.
    
    Additionally, there was an additional check if the consumer was closed 
after the lock was acquired. This check is no longer necessary.
    
    This is my original work and I license it to the project under the 
project's open source license.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tbrooks8/kafka KAFKA-2311

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/1637.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 #1637
    
----
commit 23e457ae0b6008306ea7c4ef6fcd63f409db84a5
Author: Tim Brooks <[email protected]>
Date:   2016-07-19T17:08:18Z

    Change closed indicator to volatile. Remove unnecessary closed check.

----


> Consumer's ensureNotClosed method not thread safe
> -------------------------------------------------
>
>                 Key: KAFKA-2311
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2311
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>            Reporter: Tim Brooks
>            Assignee: Tim Brooks
>             Fix For: 0.10.1.0
>
>         Attachments: KAFKA-2311.patch, KAFKA-2311.patch
>
>
> When a call is to the consumer is made, the first check is to see that the 
> consumer is not closed. This variable is not volatile so there is no 
> guarantee previous stores will be visible before a read.



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

Reply via email to