You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lucasbru (via GitHub)" <gi...@apache.org> on 2025/06/03 12:42:08 UTC

Re: [PR] KAFKA-10551: Add topic id support to produce request and response [kafka]

lucasbru commented on PR #15968:
URL: https://github.com/apache/kafka/pull/15968#issuecomment-2935052103

   @OmniaGM Hey, I detected the following NPE during Kafka Streams soak testing (on trunk):
   
   ```
   [2025-05-29 04:06:05,855] ERROR [kafka-producer-network-thread | i-07bbab180f6062ba3-StreamThread-3-producer] [Producer clientId=i-07bbab180f6062ba3-StreamThread-3-producer] Uncaught error in request completion: (org.apache.kafka.clients.NetworkClient)
   java.lang.NullPointerException: Cannot read field "topicPartition" because "batch" is null
   	at org.apache.kafka.clients.producer.internals.TransactionManager.handleCompletedBatch(TransactionManager.java:748)
   	at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:736)
   	at org.apache.kafka.clients.producer.internals.Sender.completeBatch(Sender.java:710)
   	at org.apache.kafka.clients.producer.internals.Sender.lambda$handleProduceResponse$2(Sender.java:613)
   	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
   	at org.apache.kafka.clients.producer.internals.Sender.lambda$handleProduceResponse$3(Sender.java:597)
   	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
   	at org.apache.kafka.clients.producer.internals.Sender.handleProduceResponse(Sender.java:597)
   	at org.apache.kafka.clients.producer.internals.Sender.lambda$sendProduceRequest$9(Sender.java:895)
   	at org.apache.kafka.clients.ClientResponse.onComplete(ClientResponse.java:154)
   	at org.apache.kafka.clients.NetworkClient.completeResponses(NetworkClient.java:669)
   	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:661)
   	at org.apache.kafka.clients.producer.internals.Sender.runOnce(Sender.java:340)
   	at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:242)
   	at java.base/java.lang.Thread.run(Thread.java:840)
   ```
   
   It seems likely to me that this may be caused by this PR, given the changes in `Sender.handleProduceResponse`. Could be a race-condition around topic metadata, but I don't understand the details well enough to fix it myself. Could you please take a look?
   
   cc @jolshan 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org