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

KafkaProducer#send(ProducerRecord,Callback) may block for up to 60 seconds

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • clients, producer
    • None

    Description

      Hello. I was running reactor-kafka with the BlockHound agent (you can see the progress here and even run it yourself) and it detected a very dangerous blocking call in KafkaProducer#send(ProducerRecord,Callback) which is supposed to be async:

      java.lang.Error: Blocking call! java.lang.Object#wait
      	at reactor.BlockHound$Builder.lambda$new$0(BlockHound.java:154)
      	at reactor.BlockHound$Builder.lambda$install$8(BlockHound.java:254)
      	at reactor.BlockHoundRuntime.checkBlocking(BlockHoundRuntime.java:43)
      	at java.lang.Object.wait(Object.java)
      	at org.apache.kafka.clients.Metadata.awaitUpdate(Metadata.java:181)
      	at org.apache.kafka.clients.producer.KafkaProducer.waitOnMetadata(KafkaProducer.java:938)
      	at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:823)
      	at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:803)
      

      it blocks for up to "maxBlockTimeMs" (60 seconds by default)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bsideup Sergei Egorov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: