You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Kevin (JIRA)" <ji...@apache.org> on 2019/04/23 11:08:00 UTC

[jira] [Created] (KAFKA-8278) MockConsumer.poll and MockConsumer.wakupe are both synchronized

Kevin created KAFKA-8278:
----------------------------

             Summary: MockConsumer.poll and MockConsumer.wakupe are both synchronized
                 Key: KAFKA-8278
                 URL: https://issues.apache.org/jira/browse/KAFKA-8278
             Project: Kafka
          Issue Type: Bug
          Components: unit tests
    Affects Versions: 2.0.1
            Reporter: Kevin


The MockConsumer's wakeup() and poll() methods are synchronized where the normal KafkaConsumer's are not. This means that code written using the example in the "Multi-threaded Processing" of the [KafkaConsumer docs]([https://kafka.apache.org/20/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html]) cannot be tested with the MockConsumer, as a long-running poll will not be aborted by a call to wakeup() because wakeup() will not execute due to poll() holding the object lock.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)