conduktor.io ↗

KIP-1205 — Improve RecordHeader to be Thread-Safe

Accepted Kafka 4.2 ProtocolClient

Makes RecordHeader thread-safe by using double-checked locking and volatile fields during lazy initialization of the value byte array. Lazy initialization introduced in KAFKA-10438 caused NullPointerException when multiple threads performed concurrent read-only access to ConsumerRecord headers, leading to three reported concurrency bugs.

Details

AuthorMing-Yen Chung
StatusAccepted
Kafka Version4.2
JIRAKAFKA-12999
WikiView on Apache Wiki
Created2025-08-18
Last Modified2025-11-02
Explore how this KIP affects the Kafka protocol in the Protocol Explorer, or see the full KIP database.