Xiaobing Fang created KAFKA-17725:
-------------------------------------

             Summary: RecordHeader key() is not thread safe
                 Key: KAFKA-17725
                 URL: https://issues.apache.org/jira/browse/KAFKA-17725
             Project: Kafka
          Issue Type: Bug
          Components: clients
            Reporter: Xiaobing Fang


{code:java}
public String key() {
    if (key == null) {
        key = Utils.utf8(keyBuffer, keyBuffer.remaining());
        keyBuffer = null;
    }
    return key;
} {code}
This method in RecordHeader is not thread safe.

It may throw NPE when it is accessed concurrently by multiple threads, because 
keyBuffer maybe null by pre thread.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to