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

NewProducer NullPointerException on ProduceRequest

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 0.8.2.1, 0.9.0.1
    • None
    • network, producer
    • linux 3.2.0 debian7

    Description

      The producer upon send.get() on the future appends to the accumulator the record batches and the Sender.java (separate thread) flushes it to the server. The produce request waits on the countDownLatch in the FutureRecordMetadata:
      public RecordMetadata get() throws InterruptedException, ExecutionException {
      this.result.await();

      In this case, the client thread is blocked for ever (as it is get() without timeout) for the response and the response upon poll by the Sender returns an attachment with the batch value as null. The batch is processed and the request is errored out. The Sender catches a global level exception and then goes ahead. As the accumulator is drained, the response will never be returned and the producer client thread calling get() is blocked for ever on the latch await call.

      I checked at the server end but still haven't found the reason for null batch. Any pointers on this?

      ERROR [2016-05-01 21:00:09,256] [kafka-producer-network-thread |producer-app] [Sender] message_id: group_id: : Uncaught error in kafka producer I/O thread:
      ! java.lang.NullPointerException: null
      ! at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:266)
      ! at org.apache.kafka.clients.producer.internals.Sender.handleResponse(Sender.java:236)
      ! at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:196)
      ! at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:122)
      ! at java.lang.Thread.run(Thread.java:745)

      Attachments

        Activity

          People

            junrao Jun Rao
            vamsi360 Vamsi Subhash Achanta
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: