kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Smirnov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-5263) kakfa-clients consume 100% CPU with manual partition assignment
Date Wed, 17 May 2017 15:35:04 GMT

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

Konstantin Smirnov commented on KAFKA-5263:
-------------------------------------------

Sample code leading to the trouble:
{code}
public static void main(String[] args) {
        System.out.println("Starting consumer");
        Properties props = new Properties();
        props.put("bootstrap.servers", "localhost:9092");
        props.put("group.id", "test12345");
        props.put("reconnect.backoff.ms", "1000");
        props.put("retry.backoff.ms", "1000");
        props.put("session.timeout.ms", "10000");
        props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        
        try (KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props))
{
            String topic = "test-topic"; 
//            consumer.subscribe(Arrays.asList(topic));
            List<TopicPartition> partitions = new ArrayList<>();
            for (PartitionInfo partition : consumer.partitionsFor(topic)) {
                partitions.add(new TopicPartition(topic, partition.partition()));
            }
            consumer.assign(partitions);
            for (;;) {
                ConsumerRecords<String, String> records = consumer.poll(1000);
                if (!records.isEmpty()) {
                    System.out.println("Records aren't empty!");
                }
                records.forEach(System.out::println);
            }
        }
    }
{code}

> kakfa-clients consume 100% CPU with manual partition assignment
> ---------------------------------------------------------------
>
>                 Key: KAFKA-5263
>                 URL: https://issues.apache.org/jira/browse/KAFKA-5263
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients
>    Affects Versions: 0.10.1.0, 0.10.1.1, 0.10.2.0, 0.10.2.1
>            Reporter: Konstantin Smirnov
>
> Noticed that lose of the connection to Kafka broker leads kafka-clients to consume 100%
CPU. The bug only appears when the manual partition assignmet is used. It appears since the
version 0.10.1.0. The bug is quite similar to KAFKA-1642.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message