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

Kafka Streams fails with NPE for missing RecordContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.9.0
    • 3.9.0
    • streams
    • None

    Description

      He did observe a crash of Kafka Streams with the following stack trace:

      2024-09-10 10:59:12,301] ERROR [kafka-producer-network-thread | i-0197827b22f4d4e4c-StreamThread-1-producer] Error executing user-provided callback on message for topic-partition 'stream-soak-test-KSTREAM-AGGREGATE-STATE-STORE-0000000047-changelog-1' (org.apache.kafka.clients.producer.internals.ProducerBatch)
      java.lang.NullPointerException: Cannot invoke "org.apache.kafka.streams.processor.internals.InternalProcessorContext.recordContext()" because "context" is null
          at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.recordSendError(RecordCollectorImpl.java:405)
          at org.apache.kafka.streams.processor.internals.RecordCollectorImpl.lambda$send$1(RecordCollectorImpl.java:285)
          at org.apache.kafka.clients.producer.KafkaProducer$AppendCallbacks.onCompletion(KafkaProducer.java:1574)
          at org.apache.kafka.clients.producer.internals.ProducerBatch.completeFutureAndFireCallbacks(ProducerBatch.java:312)
          at org.apache.kafka.clients.producer.internals.ProducerBatch.abort(ProducerBatch.java:200)
          at org.apache.kafka.clients.producer.internals.RecordAccumulator.abortUndrainedBatches(RecordAccumulator.java:1166)
          at org.apache.kafka.clients.producer.internals.Sender.maybeSendAndPollTransactionalRequest(Sender.java:474)
          at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:337)
          at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:251)
          at java.base/java.lang.Thread.run(Thread.java:840) 

      It seems to be a bug introduced via KIP-1033, coming from the changelogging layer which does pass a `null` context into `RecordCollector.send(...)`.

      Attachments

        Issue Links

          Activity

            People

              mjsax Matthias J. Sax
              mjsax Matthias J. Sax
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: