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

Tim Brooks commented on KAFKA-2129:
-----------------------------------

Since post-2168 it seems to be explicitly documented that the consumer is not 
thread safe, and every public method (besides wakeup) requires a thread to gain 
ownership before entering the consumer, this ticket seems to be resolved.

- Tim

> Consumer could make multiple concurrent metadata requests
> ---------------------------------------------------------
>
>                 Key: KAFKA-2129
>                 URL: https://issues.apache.org/jira/browse/KAFKA-2129
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>            Reporter: Tim Brooks
>            Assignee: Tim Brooks
>         Attachments: KAFKA-2129.patch
>
>
> The NetworkClient's metadataFetchInProgress is neither volatile nor atomic. 
> This protects against multiple metadata requests being made and is read on 
> poll() on the NetworkClient. It is written to when a request is initiated.
> This is fine for the producer. Which seems to have one thread writing. The 
> KafkaConsumer's poll()  method is synchronized, so there will not be more 
> than one writer entering from there. However, the NetworkClient's poll() 
> method is also accessed on the Consumer's partitionsFor() method. Which could 
> be access by a separate thread.



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

Reply via email to