Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-5766

Very high CPU-load of consumer when broker is down

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • consumer
    • None

    Description

      Hi,
      i have a single broker instance at localhost.
      I set up a Consumer with the following code:

              Map<String, Object> configs = new HashMap<>();
              configs.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
              configs.put(ConsumerConfig.GROUP_ID_CONFIG, "gh399");
              configs.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
              configs.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
              KafkaConsumer<String, String> consumer = new KafkaConsumer<>(configs);
              consumer.assign(Collections.singletonList(new TopicPartition("foo", 0)));
              while (true) {
                  ConsumerRecords<String, String> records = consumer.poll(1000);
                  System.out.println(records.count());
              }
      

      This works all fine, until i shut down the broker.
      If i do so, it causes a 100% CPU-load of my application.
      After starting the broker again the usage decreases back to a normal level.

      It would be very nice if you could help me!
      Thanks,
      Sebastian

      Spring-Kafka: 2.0.0.M3
      Kafka: 0.10.2.0
      JDK: 1.8.0_121

      Attachments

        Activity

          People

            Unassigned Unassigned
            sbernauer Sebastian Bernauer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: