puneeth1999 opened a new pull request, #24417:
URL: https://github.com/apache/kafka/pull/24417

   ### Problem
   The records field of a Produce partition is nullable in the schema. Since 
3.8.0, a partition with null records makes the broker throw a 
NullPointerException before any response is sent, so the connection stalls 
until the client's request
   timeout.
   
   ### Change
   - `KafkaApis` answers such a partition with `INVALID_RECORD`, like it does 
for an empty batch, instead of passing null records on to the append path.
   - `ProduceRequest#partitionSizes` tolerates null records, so describing a 
request or building its error response cannot throw and mask the error. This is 
needed on its own: with `TRACE` logging on `KafkaApis`, the first change alone 
still stalls
     through the same method.
   
   ### Testing
   New tests in `ProduceRequestTest` and `KafkaApisTest`. I also reproduced the 
stall on an unpatched 4.4.0 broker and confirmed that the same change makes it 
answer `INVALID_RECORD` while the connection stays usable.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to